:root {
  --bg: #0A0E0C;
  --surface: #121815;
  --surface-2: #19211D;
  --line: #222C27;
  --text: #EEF3F0;
  --muted: #8A9891;
  --faint: #5C6A63;
  --brand: #00B53E;
  --brand-hi: #22D360;
  --brand-soft: rgba(0, 181, 62, .14);
  --warn: #F2B53A;
  --warn-soft: rgba(242, 181, 58, .14);
  --bad: #F2625A;
  --bad-soft: rgba(242, 98, 90, .14);
  --info: #6AA8FF;
  --radius: 18px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  min-height: 100dvh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.hidden-values .money { filter: blur(9px); user-select: none; }

/* ------------------------------------------------ layout */
.shell { max-width: 1120px; margin: 0 auto; padding: calc(var(--safe-t) + 14px) 16px calc(var(--nav-h) + var(--safe-b) + 24px); }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.topbar img { width: 38px; height: 38px; border-radius: 11px; }
.topbar .title { flex: 1; min-width: 0; }
.topbar h1 { font-size: 18px; margin: 0; font-weight: 800; letter-spacing: -.02em; }
.topbar .sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-hi); box-shadow: 0 0 0 0 rgba(34, 211, 96, .6); animation: pulse 2s infinite; }
.live-dot.off { background: var(--faint); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 211, 96, .55); } 70% { box-shadow: 0 0 0 8px rgba(34, 211, 96, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 211, 96, 0); } }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; }

/* ------------------------------------------------ chips */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 16px; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: 12px; }
.card h3 { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: flex; justify-content: space-between; align-items: center; }
.card h3 a, .card h3 button { text-transform: none; letter-spacing: 0; color: var(--brand-hi); font-size: 13px; text-decoration: none; font-weight: 700; }

.hero { position: relative; overflow: hidden; padding: 18px 18px 8px; background: radial-gradient(120% 90% at 100% 0%, rgba(0, 181, 62, .22), transparent 60%), var(--surface); }
.hero .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.hero .big { font-size: clamp(32px, 9vw, 44px); font-weight: 800; letter-spacing: -.035em; margin: 2px 0 6px; line-height: 1.1; }
.hero .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 12px; padding: 3px 8px; border-radius: 999px; }
.delta.up { color: var(--brand-hi); background: var(--brand-soft); }
.delta.down { color: var(--bad); background: var(--bad-soft); }
.delta.flat { color: var(--muted); background: var(--surface-2); }

.chart { position: relative; height: 150px; margin: 12px -18px 0; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: 100%; }
.chart .tip { position: absolute; top: 4px; transform: translateX(-50%); background: var(--text); color: var(--bg); font-size: 12px; font-weight: 700; padding: 5px 9px; border-radius: 9px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; }
.chart .tip small { display: block; font-weight: 600; opacity: .65; font-size: 11px; }
.chart.scrub .tip { opacity: 1; }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); padding: 2px 0 8px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 620px) { .grid.k4 { grid-template-columns: repeat(4, 1fr); } }
.kpi { padding: 14px; }
.kpi .k { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .k i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.kpi .v { font-size: 22px; font-weight: 800; letter-spacing: -.025em; margin-top: 4px; }
.kpi .s { font-size: 12px; color: var(--faint); margin-top: 2px; }

/* ------------------------------------------------ bars / rankings */
.rank { display: flex; flex-direction: column; gap: 14px; }
.rank-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; }
.rank-row .n { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .r { font-weight: 800; text-align: right; }
.rank-row .d { font-size: 12px; color: var(--muted); }
.rank-row .d2 { font-size: 12px; color: var(--muted); text-align: right; }
.bar { grid-column: 1 / -1; height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.rank-row.clickable { cursor: pointer; }
.pos { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 800; margin-right: 8px; vertical-align: 1px; }
.rank-row:first-child .pos { background: var(--brand); color: #fff; }

.methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.method { background: var(--surface-2); border-radius: 14px; padding: 12px; }
.method .t { font-size: 12px; color: var(--muted); font-weight: 700; }
.method .v { font-size: 15px; font-weight: 800; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.02em; }
.method .c { font-size: 11px; color: var(--faint); margin-top: 2px; }

.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; align-items: end; height: 56px; }
.hours span { background: var(--brand); border-radius: 3px 3px 1px 1px; min-height: 3px; opacity: .25; }
.hours span.on { opacity: 1; }
.hours-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); margin-top: 6px; }

/* ------------------------------------------------ sales list */
.list { display: flex; flex-direction: column; }
.sale { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); width: 100%; text-align: left; }
.sale:first-child { border-top: 0; }
.sale .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.sale .ic svg { width: 20px; height: 20px; }
.sale .mid { flex: 1; min-width: 0; }
.sale .p { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sale .w { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sale .amt { text-align: right; font-weight: 800; }
.sale .amt small { display: block; font-weight: 600; font-size: 11px; color: var(--muted); }
.st-approved .ic { background: var(--brand-soft); color: var(--brand-hi); }
.st-pending .ic { background: var(--warn-soft); color: var(--warn); }
.st-refunded .ic, .st-chargeback .ic { background: var(--bad-soft); color: var(--bad); }
.st-refused .ic, .st-canceled .ic, .st-other .ic { background: var(--surface-2); color: var(--faint); }
.st-refunded .amt, .st-chargeback .amt, .st-canceled .amt, .st-refused .amt { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 2px 6px; border-radius: 6px; text-transform: uppercase; vertical-align: 1px; }
.tag.test { background: rgba(106, 168, 255, .15); color: var(--info); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; }
.pill.approved { background: var(--brand-soft); color: var(--brand-hi); }
.pill.pending { background: var(--warn-soft); color: var(--warn); }
.pill.refunded, .pill.chargeback { background: var(--bad-soft); color: var(--bad); }
.pill.refused, .pill.canceled, .pill.other { background: var(--surface-2); color: var(--muted); }
.day-sep { font-size: 12px; font-weight: 700; color: var(--muted); padding: 18px 0 6px; text-transform: capitalize; display: flex; justify-content: space-between; }

.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; margin-bottom: 12px; }
.search svg { width: 18px; height: 18px; color: var(--faint); flex: none; }
.search input { flex: 1; background: none; border: 0; outline: 0; padding: 12px 0; font-size: 15px; min-width: 0; }

.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty img { width: 56px; height: 56px; border-radius: 16px; opacity: .85; margin-bottom: 10px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

/* ------------------------------------------------ buttons / forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 16px; border-radius: 14px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); width: 100%; transition: transform .1s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }
.row-btns { display: flex; gap: 8px; }
.field { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; outline: 0; font-size: 16px; }
.field:focus { border-color: var(--brand); }
.copybox { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 14px; padding: 10px 10px 10px 12px; }
.copybox code { flex: 1; min-width: 0; font-size: 12px; word-break: break-all; color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.copybox button { flex: none; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: 13px; }

.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: 0; }
.set-row .t { font-weight: 700; }
.set-row .d { font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; width: 24px; height: 24px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .2s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.switch input:checked + span { background: var(--brand); border-color: var(--brand); }
.switch input:checked + span::after { transform: translateX(20px); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { padding: 8px 4px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.note { font-size: 13px; color: var(--muted); line-height: 1.5; }
.note b { color: var(--text); }
.banner { display: flex; gap: 12px; align-items: center; background: var(--brand-soft); border: 1px solid rgba(0, 181, 62, .35); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.banner .bt { flex: 1; font-size: 13px; }
.banner .bt b { display: block; font-size: 14px; }
.banner .btn { width: auto; padding: 10px 14px; }
.steps { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.steps b { color: var(--text); }
pre.raw { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 11px; overflow: auto; max-height: 340px; color: #B7C7BE; margin: 8px 0 0; white-space: pre-wrap; word-break: break-all; }
details summary { cursor: pointer; font-weight: 700; color: var(--muted); font-size: 13px; padding: 8px 0; }

/* ------------------------------------------------ nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(10, 14, 12, .86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.nav-in { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--nav-h); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); text-decoration: none; font-size: 11px; font-weight: 700; }
.nav a svg { width: 22px; height: 22px; }
.nav a.on { color: var(--brand-hi); }

/* ------------------------------------------------ sheet */
.sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55); animation: fade .2s; }
.sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-width: 760px; margin: 0 auto; max-height: 90dvh; overflow: auto; background: var(--surface); border-radius: 24px 24px 0 0; border: 1px solid var(--line); padding: 10px 18px calc(24px + var(--safe-b)); animation: up .28s cubic-bezier(.2, .8, .2, 1); }
.sheet .grab { width: 40px; height: 5px; background: var(--line); border-radius: 9px; margin: 0 auto 14px; }
.sheet .amt-big { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 2px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14px; margin-top: 8px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; word-break: break-word; }
.sec-t { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 20px 0 4px; }
.timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.timeline li { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } }

/* ------------------------------------------------ toast */
#toast-root { position: fixed; z-index: 60; top: calc(var(--safe-t) + 10px); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: center; width: min(420px, 100%); background: #F4F8F6; color: #0A0E0C; border-radius: 18px; padding: 12px 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .45); animation: drop .4s cubic-bezier(.2, 1.2, .3, 1); }
.toast img { width: 38px; height: 38px; border-radius: 10px; }
.toast .tt { font-weight: 800; font-size: 14px; }
.toast .tb { font-size: 13px; color: #3c4a43; }
.toast.simple { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); justify-content: center; font-weight: 700; font-size: 14px; width: auto; padding: 10px 16px; }
.toast.out { animation: rise .3s forwards; }
@keyframes drop { from { transform: translateY(-120%); opacity: 0; } }
@keyframes rise { to { transform: translateY(-120%); opacity: 0; } }

/* ------------------------------------------------ login */
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 32px 24px calc(32px + var(--safe-b)); max-width: 420px; margin: 0 auto; }
.login img { width: 84px; height: 84px; border-radius: 24px; margin-bottom: 22px; box-shadow: 0 16px 50px rgba(0, 181, 62, .35); }
.login h1 { font-size: 28px; letter-spacing: -.03em; margin: 0 0 6px; }
.login p { color: var(--muted); margin: 0 0 24px; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.err { color: var(--bad); font-size: 13px; font-weight: 600; min-height: 18px; }

.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }
.fade-in { animation: fade .25s; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.cur-btn { width: auto; min-width: 40px; padding: 0 10px; font-weight: 800; font-size: 13px; color: var(--brand-hi); }

/* ------------------------------------------------ análise */
.an-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
.an-grid > .card { margin: 0; min-width: 0; }
@media (min-width: 900px) { .an-grid { grid-template-columns: 1fr 1fr; } .an-grid > .wide { grid-column: 1 / -1; } }
.grid > .card { margin: 0; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: -4px 0 10px; min-height: 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sw.dash { height: 0; width: 14px; border-top: 2px dashed #8A9891; border-radius: 0; }
.vchart { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; column-gap: 8px; row-gap: 6px; height: 220px; }
@media (min-width: 900px) { .wide .vchart { height: 280px; } }
.yaxis { display: flex; flex-direction: column; justify-content: space-between; font-size: 10px; color: var(--faint); text-align: right; margin: -6px 0; white-space: nowrap; }
.plot { position: relative; min-width: 0; }
.grid3 { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.grid3 i { border-top: 1px dashed var(--line); }
.grid3 i:last-child { border-top: 1px solid var(--line); }
.bars { position: absolute; inset: 0; display: flex; align-items: stretch; }
.bars .col { flex: 1; display: flex; align-items: flex-end; min-width: 0; cursor: default; }
.bars .col span { display: block; width: 100%; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 0; transition: filter .15s; }
.bars .col.hl span, .bars .col:hover span { filter: brightness(1.35); }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.hits { position: absolute; inset: 0; display: flex; }
.hits i { flex: 1; }
.hits i.hl { background: linear-gradient(to right, transparent calc(50% - .5px), rgba(238,243,240,.35) calc(50% - .5px), rgba(238,243,240,.35) calc(50% + .5px), transparent calc(50% + .5px)); }
.xaxis { grid-column: 2; display: flex; font-size: 10px; color: var(--faint); }
.xaxis span { flex: 1; white-space: nowrap; overflow: visible; }
.xaxis span:last-child { text-align: right; }
.vtip { position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none; background: #F4F8F6; color: #0A0E0C; font-size: 12px; line-height: 1.45; padding: 7px 10px; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.45); opacity: 0; transition: opacity .12s; max-width: 260px; }
.vtip.on { opacity: 1; }
.vtip b { font-weight: 800; }

.donut { display: grid; grid-template-columns: minmax(120px, 160px) 1fr; gap: 16px; align-items: center; }
@media (max-width: 560px) { .donut { grid-template-columns: 1fr; } .donut svg { max-width: 180px; margin: 0 auto; } }
.donut svg { width: 100%; height: auto; display: block; }
.donut circle { cursor: default; transition: stroke-width .15s; }
.donut circle.hl, .donut circle:hover { stroke-width: 17; }
.dn-v { fill: var(--text); font-size: 16px; font-weight: 800; }
.dn-l { fill: var(--muted); font-size: 7px; font-weight: 600; }
.dlegend, .slegend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; min-width: 0; }
.dlegend li, .slegend li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dlegend .nm, .slegend span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlegend b, .slegend b { font-weight: 800; white-space: nowrap; }
.dlegend em, .slegend em { font-style: normal; color: var(--muted); font-size: 12px; width: 40px; text-align: right; }
.slegend .si { width: 14px; height: 14px; color: var(--muted); flex: none; }
.stack { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; margin-bottom: 14px; }
.stack span { min-width: 3px; }

.funnel { display: flex; flex-direction: column; gap: 14px; }
.fn-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.fn-n { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fn-top b { font-weight: 800; }
.fn-bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 6px 0 4px; }
.fn-bar span { display: block; height: 100%; border-radius: 99px; }
.fn-sub { font-size: 12px; color: var(--muted); }
.kind { display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 6px; margin-right: 8px; vertical-align: 1px; background: var(--surface-2); color: var(--muted); }
.kind.k-main { background: var(--brand-soft); color: var(--brand-hi); }

.wk { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 150px; }
.wk-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wk-bar { flex: 1; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line); }
.wk-bar span { width: 100%; background: var(--brand); border-radius: 4px 4px 0 0; }
.wk-col.hl .wk-bar span { filter: brightness(1.35); opacity: 1 !important; }
.wk-l { font-size: 11px; color: var(--muted); text-align: center; font-weight: 700; }

.heat { display: grid; grid-template-columns: 30px repeat(24, 1fr); gap: 2px; align-items: center; }
.heat i { aspect-ratio: 1; background: var(--surface-2); border-radius: 3px; min-width: 0; }
.heat i.hl { outline: 2px solid var(--text); outline-offset: -1px; }
.hm-l { font-size: 10px; color: var(--muted); font-weight: 700; }
.hm-x { font-size: 9px; color: var(--faint); white-space: nowrap; overflow: visible; }
.hm-scale { display: flex; align-items: center; gap: 3px; justify-content: flex-end; margin-top: 10px; font-size: 10px; color: var(--faint); }
.hm-scale i { width: 12px; height: 12px; border-radius: 3px; }
.hm-scale span { margin: 0 4px; }

.proj .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.proj .big2 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin: 2px 0; }
.proj .s { font-size: 12px; color: var(--faint); }
.proj-bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 12px 0 6px; }
.proj-bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 6px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; white-space: nowrap; }
.tbl td:first-child { max-width: 260px; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.tsub { font-size: 11px; color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.nav a { font-size: 10.5px; }
/* cards de indicador: mesma altura em todas as linhas, com ou sem selo de variação */
.grid { align-items: stretch; }
.kpi { display: flex; flex-direction: column; }
.kpi .s { margin-top: auto; padding-top: 4px; min-height: 26px; }
.kpi .s .delta { margin-top: 1px; }

/* ------------------------------------------------ estrutura à prova de iPhone
   O app ocupa a tela inteira; só .scroller rola. O menu é um item normal no fim,
   não "position: fixed", então não se desloca na rolagem com embalo do iOS. */
html, body { height: 100%; overflow: hidden; }
body { min-height: 0; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; padding-top: var(--safe-t); background: var(--bg); overflow: hidden; }
#screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scroller { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
.shell { padding-top: 14px; padding-bottom: 24px; }
.nav { position: relative; left: auto; right: auto; bottom: auto; flex: none; background: rgba(10, 14, 12, .97); backdrop-filter: none; -webkit-backdrop-filter: none; }
.login { min-height: 0; flex: 1; overflow-y: auto; }

.wopts { display: grid; gap: 8px; margin-top: 10px; }
.wopts div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.wopts b { display: block; }
.wopts span { color: var(--muted); }
.wparams dt code, .note code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; color: var(--brand-hi); }
.wparams dd { text-align: left; color: var(--muted); font-weight: 500; }

.goal { margin: 12px 0 4px; }
.goal-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 600; }
.goal-top b { color: var(--text); font-weight: 800; }
.goal-bar { height: 8px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; margin: 6px 0 4px; }
.goal-bar span { display: block; height: 100%; background: var(--brand-hi); border-radius: 99px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.goal-sub { font-size: 12px; color: var(--faint); }
select.field { appearance: none; -webkit-appearance: none; background: var(--surface-2); color: var(--text); }

/* lucro e anúncios */
.pl-pos { color: var(--brand-hi); }
.pl-neg { color: var(--bad); }
.ad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
@media (min-width: 620px) { .ad-grid { grid-template-columns: repeat(4, 1fr); } }
.ad-stat .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.ad-stat .v { font-size: 22px; font-weight: 800; letter-spacing: -.025em; margin-top: 2px; }
.ad-stat .s { font-size: 12px; color: var(--faint); margin-top: 2px; min-height: 22px; }
.pbars { position: relative; display: flex; gap: 2px; height: 120px; margin-top: 8px; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); background: linear-gradient(to bottom, transparent calc(50% - .5px), var(--line) calc(50% - .5px), var(--line) calc(50% + .5px), transparent calc(50% + .5px)); }
.pb { position: relative; flex: 1; min-width: 0; }
.pb span { position: absolute; left: 0; right: 0; border-radius: 3px; }
.pb span.pl-pos { background: var(--brand); }
.pb span.pl-neg { background: var(--bad); }
.pb.hl span { filter: brightness(1.3); }
.tag.fb { background: rgba(57,135,229,.15); color: #6AA8FF; text-transform: none; letter-spacing: 0; font-size: 11px; }
.meta-box { background: var(--surface-2); border-radius: 14px; padding: 12px; margin-top: 8px; }
.unit { display: flex; align-items: center; color: var(--muted); font-weight: 700; padding: 0 2px; }
input[type="date"].field { color-scheme: dark; min-width: 0; }

.camps { display: flex; flex-direction: column; }
.camp { padding: 12px 0; border-top: 1px solid var(--line); }
.camp:first-child { border-top: 0; padding-top: 0; }
.camp-n { font-weight: 700; font-size: 14px; }
.camp-m { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.camp-m div { min-width: 0; }
.camp-m > div > span { display: block; font-size: 10px; color: var(--faint); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.camp-m b { display: block; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .camp-m { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 8px; } }

/* =====================================================================
   Visual premium (v2): vidro, títulos grandes, listas agrupadas e menu
   flutuante. Mesma paleta. Esta camada sobrepõe os estilos acima.
   ===================================================================== */
:root {
  --bg: #050806;
  --text: #F3F7F4;
  --muted: #93A39A;
  --faint: #6B7A72;
  --glass: rgba(236, 255, 244, .055);
  --glass-2: rgba(236, 255, 244, .09);
  --glass-hi: rgba(236, 255, 244, .14);
  --edge: inset 0 0 0 1px rgba(236, 255, 244, .07), inset 0 1px 0 rgba(255, 255, 255, .06);
  --lift: 0 1px 2px rgba(0, 0, 0, .25), 0 12px 32px rgba(0, 0, 0, .22);
  --r-xl: 28px;   /* cartões grandes */
  --r-lg: 22px;   /* cartões pequenos */
  --leaf: #34D46E;
  --tab-h: 64px;
}
html, body { background: var(--bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  color: var(--text);
}
#app {
  background:
    radial-gradient(90% 55% at 12% -8%, rgba(0, 181, 62, .22), transparent 62%),
    radial-gradient(70% 40% at 105% 4%, rgba(0, 181, 62, .08), transparent 60%),
    var(--bg);
}
.num, .money, .big, .v, .evo-v, .gside { font-variant-numeric: tabular-nums; }
h1, h2, h3 { text-wrap: balance; }
.note, .d, small { text-wrap: pretty; }

/* ---------- estrutura */
.shell { max-width: 680px; padding: 8px 20px calc(var(--tab-h) + var(--safe-b) + 40px); }
.shell.wide { max-width: 1120px; }
.scroller { scroll-padding-bottom: calc(var(--tab-h) + 40px); }

/* ---------- cabeçalho: ferramentas em vidro + título grande */
.topbar { display: block; margin: 0 0 18px; }
.tools {
  display: flex; gap: 2px; width: max-content; margin-left: auto; padding: 4px;
  border-radius: 24px; background: rgba(28, 34, 31, .55);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--edge), var(--lift);
}
.tool { width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center; color: var(--text); transition: background-color .15s ease, transform .12s ease; }
.tool svg { width: 21px; height: 21px; }
.tool:active { transform: scale(.92); background: var(--glass-hi); }
.tool-cur { width: auto; min-width: 40px; padding: 0 10px; font-weight: 700; font-size: 14px; letter-spacing: -.01em; color: var(--leaf); }
.topbar h1 { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -.028em; margin: 14px 0 2px; }
.topbar .sub { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }

/* ---------- cartões de vidro (sem desfoque: o fundo é estático, e desfoque em todo cartão pesa no iPhone) */
.card {
  background: linear-gradient(180deg, rgba(236, 255, 244, .07), rgba(236, 255, 244, .04));
  border: 0; border-radius: var(--r-xl); padding: 18px;
  box-shadow: var(--edge), var(--lift);
}
.card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: 12px; }
.card h3 { font-size: 17px; font-weight: 650; letter-spacing: -.012em; text-transform: none; color: var(--text); margin: 0 0 14px; }
.card h3 a, .card h3 button { font-size: 15px; font-weight: 600; color: var(--leaf); }
.sec { display: flex; align-items: baseline; justify-content: space-between; font-size: 22px; font-weight: 700; letter-spacing: -.022em; margin: 30px 4px 12px; }
.sec a { font-size: 15px; font-weight: 600; color: var(--leaf); text-decoration: none; letter-spacing: 0; padding: 8px 0 8px 12px; }
.muted { color: var(--muted); }

/* ---------- herói */
.hero { padding: 20px 20px 18px; background: linear-gradient(160deg, rgba(0, 181, 62, .16), rgba(236, 255, 244, .045) 55%); }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero-label { font-size: 15px; color: var(--muted); font-weight: 500; }
.period-pill {
  display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px 0 16px; border-radius: 20px;
  background: var(--glass-2); box-shadow: var(--edge); font-weight: 650; font-size: 15px; color: var(--text);
  transition: transform .12s ease, background-color .15s ease;
}
.period-pill svg { width: 18px; height: 18px; color: var(--muted); }
.period-pill:active { transform: scale(.96); background: var(--glass-hi); }
.hero .big { font-size: clamp(36px, 10.5vw, 48px); font-weight: 700; letter-spacing: -.035em; line-height: 1.05; margin: 14px 0 8px; }
.hero-delta { font-size: 14px; font-weight: 600; }
.hero-delta .up, .up { color: var(--leaf); }
.hero-delta .down { color: var(--bad); }
.hero-delta .muted { font-weight: 500; }
.ribbon { display: flex; gap: 3px; height: 8px; margin-top: 20px; }
.ribbon span { border-radius: 4px; min-width: 6px; transition: filter .15s ease; }
.ribbon span.hl { filter: brightness(1.3); }
.ribbon.empty { background: var(--glass-2); border-radius: 4px; }
.hero-cap { font-size: 13px; color: var(--muted); margin-top: 10px; }
.dots { letter-spacing: .12em; }
.hero .big .dots { letter-spacing: .08em; }
.hidden-values .money { filter: none; }

/* ---------- evolução */
.evo { padding: 18px 18px 14px; }
.evo-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.evo-l { font-size: 14px; color: var(--muted); font-weight: 500; }
.evo-v { font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin-top: 2px; }
.evo-r { text-align: right; font-size: 13px; }
.evo-r .muted { margin-top: 4px; }
.evo .chart { margin: 14px -18px 0; height: 160px; }
.evo .axis { padding: 4px 2px 12px; }
.seg2 { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 4px; border-radius: 22px; background: var(--glass); box-shadow: var(--edge); }
.seg2 button { height: 36px; border-radius: 18px; font-size: 14px; font-weight: 600; color: var(--muted); transition: background-color .18s ease, color .18s ease, transform .12s ease; }
.seg2 button.on { background: var(--text); color: var(--bg); }
.seg2 button:active { transform: scale(.96); }

/* ---------- indicadores */
.grid { gap: 10px; }
.kpi { padding: 16px; border-radius: var(--r-lg); }
.kpi .k { font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi .k i { display: none; }
.kpi .v { font-size: 22px; font-weight: 700; letter-spacing: -.025em; margin-top: 6px; }
.kpi .s { font-size: 12.5px; color: var(--faint); }

/* ---------- listas agrupadas (estilo Ajustes do iPhone) */
.glist {
  display: block; border-radius: var(--r-xl); overflow: hidden;
  background: linear-gradient(180deg, rgba(236, 255, 244, .065), rgba(236, 255, 244, .04));
  box-shadow: var(--edge), var(--lift); text-decoration: none; color: inherit;
}
.glist + .glist { margin-top: 12px; }
.grow, .glist .sale {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px;
  padding: 12px 16px; text-align: left; border: 0; border-radius: 0; background: none;
  transition: background-color .15s ease;
}
.grow + .grow::before, .glist .sale + .sale::before {
  content: ""; position: absolute; top: 0; right: 0; left: 66px; height: 1px; background: rgba(236, 255, 244, .07);
}
.grow:not(.static):active, .glist .sale:active, .link-row:active { background: rgba(236, 255, 244, .06); }
.gicon {
  flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  font-size: 13px; font-weight: 750; letter-spacing: -.01em; color: #fff;
  background: var(--c, var(--brand)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.gmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gmain b { font-size: 16px; font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gmain small, .gside small { font-size: 13px; color: var(--muted); font-weight: 500; }
.gside { flex: none; text-align: right; display: flex; flex-direction: column; gap: 2px; font-size: 15px; font-weight: 600; }
.gcheck svg { width: 20px; height: 20px; color: var(--leaf); }
.gempty { padding: 18px 16px; color: var(--muted); font-size: 14px; }
.gempty .empty { padding: 8px 0; }
.link-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-top: 12px; }
.link-row > svg { width: 20px; height: 20px; color: var(--faint); flex: none; }
.glist .sale .ic { width: 36px; height: 36px; border-radius: 10px; }
.glist .sale .ic svg { width: 18px; height: 18px; }
.glist .sale .p { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.glist .sale .w { font-size: 13px; }
.glist .sale .amt { font-size: 15px; font-weight: 600; }

/* lista de vendas (tela Vendas) dentro de cartão: mesmas linhas agrupadas */
.card .list .sale { padding: 12px 0; border-top: 1px solid rgba(236, 255, 244, .07); }
.card .list .sale:first-child { border-top: 0; }

/* ---------- chips de período nas outras telas */
.chips { gap: 6px; margin: 0 -20px 16px; padding: 0 20px; }
.chip { height: 36px; padding: 0 16px; display: inline-flex; align-items: center; border: 0; border-radius: 18px; background: var(--glass-2); color: var(--muted); font-weight: 600; font-size: 14px; box-shadow: var(--edge); transition: background-color .18s ease, color .18s ease, transform .12s ease; }
.chip.on { background: var(--text); color: var(--bg); box-shadow: none; }
.chip:active { transform: scale(.96); }

/* ---------- menu flutuante */
.tabbar {
  position: absolute; z-index: 30; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 8px);
  max-width: 520px; margin: 0 auto; height: var(--tab-h); padding: 6px; border-radius: 32px;
  background: rgba(20, 26, 23, .62);
  -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  box-shadow: var(--edge), 0 14px 44px rgba(0, 0, 0, .5);
}
.tabbar-in { display: grid; grid-template-columns: repeat(5, 1fr); height: 100%; gap: 2px; }
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 26px; color: var(--muted); text-decoration: none; font-size: 10.5px; font-weight: 600;
  transition: background-color .2s ease, color .2s ease, transform .12s ease;
}
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a.on, .tabbar a.hover { color: var(--text); }
.tabbar a:active { transform: scale(.94); }
.nav { display: none; }

/* ---------- folha inferior, faixas, botões, campos */
.sheet { background: rgba(22, 28, 25, .92); -webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%); border: 0; border-radius: 30px 30px 0 0; box-shadow: var(--edge); padding: 10px 16px calc(24px + var(--safe-b)); }
.sheet-title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 4px 4px 14px; }
.sheet .glist { box-shadow: var(--edge); }
.banner { border: 0; border-radius: var(--r-lg); background: linear-gradient(160deg, rgba(0, 181, 62, .2), rgba(0, 181, 62, .08)); box-shadow: var(--edge); }
.btn { border: 0; border-radius: 16px; background: var(--glass-2); box-shadow: var(--edge); min-height: 48px; transition: transform .12s ease, background-color .15s ease; }
.btn.primary { background: var(--brand); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 6px 18px rgba(0, 181, 62, .28); }
.field { border: 0; border-radius: 14px; background: var(--glass-2); box-shadow: var(--edge); }
.field:focus { outline: 2px solid var(--leaf); outline-offset: 0; }
.copybox, .meta-box, .method, .wopts div { border: 0; background: var(--glass); box-shadow: var(--edge); }
.icon-btn { border: 0; background: var(--glass-2); box-shadow: var(--edge); }
.search { border: 0; border-radius: 16px; background: var(--glass-2); box-shadow: var(--edge); }
.skeleton { background: linear-gradient(90deg, rgba(236,255,244,.04) 0%, rgba(236,255,244,.09) 50%, rgba(236,255,244,.04) 100%); background-size: 200% 100%; }
:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }
.tabbar a:focus-visible, .tool:focus-visible { outline-offset: -2px; }
@media (min-width: 900px) { .shell { padding-left: 28px; padding-right: 28px; } }
.grid > .card, .grid > .card + .card { margin: 0; }

/* ---------- bolha do menu */
.tabbar[hidden] { display: none; }
.tabbar-in { position: relative; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tabbar a { position: relative; z-index: 1; -webkit-user-drag: none; transition: color .15s ease; }
.tabbar a:active { transform: none; }
.tabbar a svg { transition: transform .15s ease-out; }
.tabbar a:active svg { transform: scale(.92); }
.bubble {
  position: absolute; z-index: 0; top: 0; left: 0; height: 100%;
  transform: translate3d(0, 0, 0); will-change: transform;
  transition: transform 280ms cubic-bezier(0.645, 0.045, 0.355, 1);
}
.bubble.instant, .bubble.dragging { transition: none; }
.bubble-in {
  display: block; width: 100%; height: 100%; border-radius: 26px;
  background: rgba(236, 255, 244, .13);
  box-shadow: inset 0 0 0 1px rgba(236, 255, 244, .08), inset 0 1px 0 rgba(255, 255, 255, .1);
  transition: transform 150ms ease-out, background-color 150ms ease;
}
.bubble.dragging .bubble-in { transform: scale(1.06); background: rgba(236, 255, 244, .19); }
@media (prefers-reduced-motion: reduce) { .bubble, .bubble-in, .tabbar a, .tabbar a svg { transition: none; } }

/* ---------- cabeçalho: voltar, ferramentas, título com período */
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.back { display: inline-flex; align-items: center; gap: 2px; height: 44px; padding: 0 14px 0 6px; margin-left: -6px; border-radius: 22px; color: var(--leaf); text-decoration: none; font-size: 17px; font-weight: 500; transition: background-color .15s ease; }
.back svg { width: 24px; height: 24px; }
.back:active { background: var(--glass-2); }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.title-col { min-width: 0; }
.title-row .period-pill { margin-bottom: 2px; flex: none; }
.topbar.has-back h1 { font-size: 30px; }

/* ---------- Ajustes */
.sgroup { margin-top: 22px; }
.profile { margin-top: 4px; }
.pf-icon { width: 52px; height: 52px; border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); flex: none; }
.profile .gmain b { font-size: 18px; }
.gicon.sm { width: 32px; height: 32px; border-radius: 9px; }
.gicon.sm svg { width: 18px; height: 18px; color: #fff; }
.grow .gval { flex: none; max-width: 42%; color: var(--muted); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow > svg:last-child { width: 18px; height: 18px; color: var(--faint); flex: none; margin-right: -4px; }
a.grow { color: inherit; text-decoration: none; }
.page-intro { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 0 4px 16px; max-width: 60ch; }
.page-foot { color: var(--faint); font-size: 13px; line-height: 1.5; margin: 12px 4px 0; }
.foot { text-align: center; color: var(--faint); font-size: 13px; margin: 28px 0 0; }
.card + .glist, .glist + .card { margin-top: 12px; }
.set-row:first-child { padding-top: 0; }
.set-row:last-child { padding-bottom: 0; }

/* ---------- entrada suave ao trocar de tela */
#screen.enter .shell { animation: screen-in 150ms ease-out; }
@keyframes screen-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #screen.enter .shell { animation: none; } }
#view.dim { opacity: .55; transition: opacity .2s ease; }

/* =====================================================================
   v2.1: contraste, áreas de toque, Vendas, Produtos e recibo da venda
   ===================================================================== */
:root { --muted: #A0AFA7; --faint: #84938B; --on-brand: #03130A; }

/* texto escuro sobre o verde (6,9:1; o branco dava 2,7:1) */
.btn.primary, .copybox button, .login .btn.primary { color: var(--on-brand); font-weight: 700; }
.btn.primary svg { color: var(--on-brand); }

/* áreas de toque de pelo menos 44px */
.chip { height: 40px; position: relative; }
.chip::after, .seg2 button::after { content: ""; position: absolute; inset: -4px -1px; }
.seg2 button { height: 40px; position: relative; }
.btn { min-height: 48px; }
.copybox button { min-height: 40px; min-width: 76px; }
.switch { position: relative; }
.switch::after { content: ""; position: absolute; inset: -8px -6px; }
details > summary { min-height: 44px; display: flex; align-items: center; list-style: none; gap: 8px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "›"; font-size: 18px; color: var(--faint); transition: transform .2s ease; }
details[open] > summary::before { transform: rotate(90deg); }
.field { min-height: 44px; }
select.field { padding-right: 14px; }

/* ---------- Vendas */
.chips.filter { margin-bottom: 8px; padding-bottom: 6px; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 28px), transparent); }
.search { min-height: 48px; margin-bottom: 12px; }
.day-h {
  position: sticky; top: -1px; z-index: 3; display: flex; justify-content: space-between; align-items: baseline;
  margin: 18px -20px 8px; padding: 10px 24px 8px; font-size: 17px; font-weight: 700; letter-spacing: -.015em;
  background: rgba(5, 8, 6, .78); -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
}
.day-h .muted { font-size: 15px; font-weight: 600; }
.filter-tag { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 4px 4px 16px; margin-bottom: 8px; border-radius: 22px; background: rgba(0, 181, 62, .14); box-shadow: var(--edge); font-size: 14px; color: var(--muted); }
.filter-tag b { color: var(--text); }
.filter-tag .tool { width: 40px; height: 40px; }

/* ---------- recibo da venda */
.sheet.receipt { max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; padding-left: 16px; padding-right: 16px; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: rgba(236, 255, 244, .25); margin: 4px auto 14px; }
.rc-head { text-align: center; padding: 6px 8px 4px; }
.rc-head .pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; font-size: 13px; font-weight: 650; }
.rc-head .pill svg { width: 15px; height: 15px; }
.rc-head .amt-big { font-size: 44px; font-weight: 700; letter-spacing: -.035em; margin: 14px 0 6px; font-variant-numeric: tabular-nums; }
.rc-prod { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.rc-sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.acts { display: flex; justify-content: center; gap: 8px; margin: 20px 0 6px; flex-wrap: wrap; }
.act { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 76px; padding: 12px 8px 10px; border-radius: 18px; background: var(--glass-2); box-shadow: var(--edge); color: var(--text); text-decoration: none; font-size: 12px; font-weight: 600; transition: transform .12s ease, background-color .15s ease; }
.act svg { width: 22px; height: 22px; color: var(--leaf); }
.act:active { transform: scale(.95); background: var(--glass-hi); }
.sh { font-size: 15px; font-weight: 650; color: var(--muted); margin: 22px 6px 8px; letter-spacing: -.005em; }
.kv-row { min-height: 48px; justify-content: space-between; }
.kv-row + .kv-row::before { left: 16px; }
.kv-k { color: var(--muted); font-size: 15px; flex: none; }
.kv-v { text-align: right; font-size: 15px; font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
.kv-v code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.tl { list-style: none; margin: 0; padding: 6px 16px; }
.tl li { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 10px; min-height: 44px; position: relative; }
.tl li + li::before { content: ""; position: absolute; left: 6px; top: -14px; height: 28px; width: 2px; background: rgba(236, 255, 244, .1); }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); justify-self: center; box-shadow: 0 0 0 3px rgba(236, 255, 244, .06); }
.tl-dot.approved { background: var(--leaf); } .tl-dot.pending { background: var(--warn); } .tl-dot.refunded, .tl-dot.chargeback { background: var(--bad); }
.tl-t { font-weight: 600; font-size: 15px; }
.tl-d { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
details.tech { margin-top: 18px; padding: 0 4px; color: var(--muted); }
details.tech .kv-row { padding-left: 0; padding-right: 0; }

/* folha: entra com mola e sai acompanhando o dedo */
.sheet { animation: sheet-up .42s cubic-bezier(.2, .9, .25, 1.05); will-change: transform; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.kpi .v { font-size: clamp(18px, 5.6vw, 22px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero.pulse { animation: hero-pulse 1.4s cubic-bezier(.2, .8, .2, 1); }
@keyframes hero-pulse {
  0% { box-shadow: var(--edge), var(--lift), 0 0 0 0 rgba(52, 212, 110, 0); }
  25% { box-shadow: var(--edge), var(--lift), 0 0 0 2px rgba(52, 212, 110, .55), 0 0 40px rgba(52, 212, 110, .35); }
  100% { box-shadow: var(--edge), var(--lift), 0 0 0 0 rgba(52, 212, 110, 0); }
}

/* ---------- entrada */
.login { flex: 1; overflow-y: auto; display: flex; flex-direction: column; justify-content: center; max-width: 420px; width: 100%; margin: 0 auto; padding: 32px 24px calc(32px + var(--safe-b)); }
.login-mark { width: 88px; height: 88px; margin-bottom: 26px; border-radius: 24px; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 18px 60px rgba(0, 181, 62, .45); }
.login-mark img { width: 100%; height: 100%; border-radius: 24px; display: block; }
.login h1 { font-size: 34px; font-weight: 700; letter-spacing: -.03em; margin: 0 0 8px; }
.login p { color: var(--muted); font-size: 16px; line-height: 1.45; margin: 0 0 28px; max-width: 34ch; }
.login form { display: flex; flex-direction: column; gap: 10px; }
.login .field { min-height: 52px; font-size: 17px; padding: 0 16px; }
.btn.big { min-height: 56px; font-size: 17px; gap: 10px; }
.btn.big svg { width: 24px; height: 24px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin: 18px 0 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: rgba(236, 255, 244, .1); }
.err { min-height: 18px; }
.sec a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0 0 16px; }
.sec { margin-bottom: 6px; }

/* iPhone ainda com a barra translúcida antiga: o fim da tela não é desenhado, então o
   menu encosta na borda que aparece (a barrinha do iPhone fica dentro da faixa morta) */
.deadband .tabbar { bottom: 8px; }
.deadband .shell { padding-bottom: calc(var(--tab-h) + 32px); }

/* checklist da skill: sem zoom automático do iPhone (campos >= 16px) e sem zoom de toque duplo */
.search input, input, select, textarea { font-size: 16px; }
button, a, input, select, label, summary { touch-action: manipulation; }
.tabbar-in { touch-action: none; }
.banner.warn { align-items: flex-start; background: linear-gradient(160deg, rgba(242, 181, 58, .16), rgba(242, 181, 58, .06)); }
.banner.warn .bt b { margin-bottom: 4px; }
.banner.warn .steps { margin: 6px 0 0; }
.banner .tool { flex: none; }
.banner .steps b { display: inline; margin: 0; font-size: inherit; }
.banner.warn .steps { padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.55; }

/* =====================================================================
   Menu mais baixo (dentro da área da barrinha do iPhone, como no iOS 26)
   e desfoque progressivo do conteúdo que passa por trás dele.
   ===================================================================== */
:root { --tab-bottom: max(6px, calc(var(--safe-b) - 20px)); }
.tabbar { bottom: var(--tab-bottom); }
.deadband { --tab-bottom: 8px; }
.shell { padding-bottom: calc(var(--tab-h) + var(--tab-bottom) + 44px); }
.deadband .shell { padding-bottom: calc(var(--tab-h) + 44px); }

.bottom-fade {
  position: absolute; z-index: 20; left: 0; right: 0; bottom: 0; pointer-events: none;
  height: calc(var(--tab-h) + var(--tab-bottom) + 40px);
}
.bottom-fade::before, .bottom-fade::after { content: ""; position: absolute; inset: 0; }
/* camada leve: começa a borrar e escurece um pouco */
.bottom-fade::before {
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  background: linear-gradient(to bottom, rgba(5, 8, 6, 0) 0%, rgba(5, 8, 6, .35) 70%, rgba(5, 8, 6, .55) 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 45%); mask-image: linear-gradient(to bottom, transparent 0%, #000 45%);
}
/* camada forte: só na parte de baixo, onde o conteúdo some atrás do menu */
.bottom-fade::after {
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 35%, #000 80%); mask-image: linear-gradient(to bottom, transparent 35%, #000 80%);
}
#app:has(.tabbar[hidden]) .bottom-fade { display: none; }

/* =====================================================================
   Topo sem emenda: o iPhone pinta a barra de status com a cor lisa do tema
   (#050806). O fundo do app começa exatamente nessa cor e o brilho verde
   surge aos poucos abaixo dela.
   ===================================================================== */
#app {
  background:
    linear-gradient(to bottom, #050806 0px, rgba(5, 8, 6, 0) 150px),
    radial-gradient(90% 55% at 12% -8%, rgba(0, 181, 62, .22), transparent 62%),
    radial-gradient(70% 40% at 105% 4%, rgba(0, 181, 62, .08), transparent 60%),
    #050806;
}
/* ao rolar, o conteúdo some suavemente sob a barra de status em vez de ser cortado */
.top-fade {
  position: absolute; z-index: 20; top: 0; left: 0; right: 0; height: 36px; pointer-events: none;
  opacity: 0; transition: opacity 150ms ease;
}
.top-fade::before, .top-fade::after { content: ""; position: absolute; inset: 0; }
.top-fade::before {
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  background: linear-gradient(to top, rgba(5, 8, 6, 0) 0%, rgba(5, 8, 6, .7) 60%, #050806 100%);
  -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 60%); mask-image: linear-gradient(to top, transparent 0%, #000 60%);
}
.top-fade::after {
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to top, transparent 40%, #000 90%); mask-image: linear-gradient(to top, transparent 40%, #000 90%);
}
#app.scrolled .top-fade { opacity: 1; }
#app:has(.tabbar[hidden]) .top-fade { display: none; }
@media (prefers-reduced-motion: reduce) { .top-fade { transition: none; } }
