/* =========================================================
   PORTAL DA CREATOR (PWA)
   ========================================================= */
.portal { background: var(--cream); }
.papp { min-height: 100svh; }

.ptop {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 18px 12px;
  background: rgba(241,233,225,.86); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  transition: box-shadow .4s;
}
.ptop.is-scrolled { box-shadow: 0 1px 0 var(--line); }
.ptop__brand { display: block; width: 104px; color: var(--ink); }
.ptop__brand svg { width: 100%; height: auto; }
.ptop__actions { display: flex; align-items: center; gap: 10px; }
.ptop__me { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; }
#refreshBtn.is-spinning svg { animation: spin .9s linear infinite; }

.pmain { max-width: 640px; margin: 0 auto; padding: 8px 16px calc(40px + env(safe-area-inset-bottom)); display: grid; gap: 16px; }

.greet { padding: 10px 2px 2px; animation: fadeUp .8s var(--ease-out) both; }
.greet__title { margin: 6px 0 0; font-size: clamp(34px, 9vw, 44px); font-weight: 300; line-height: 1.05; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } }

/* meses */
.months { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; scroll-snap-type: x proximity; }
.months::-webkit-scrollbar { display: none; }
.months .chip { flex: none; scroll-snap-align: start; }

/* cartão principal */
.hero-card {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 24px 22px 18px; border-radius: 26px; background: var(--ink); color: var(--cream);
  box-shadow: 0 30px 60px -30px rgba(22,18,15,.7);
  animation: fadeUp .9s var(--ease-out) .05s both;
}
.hero-card::before { content: ""; position: absolute; z-index: -1; width: 380px; height: 380px; right: -120px; top: -170px; border-radius: 50%; background: radial-gradient(circle, rgba(213,194,180,.28), transparent 62%); }
.hero-card__mark { position: absolute; z-index: -1; right: -40px; bottom: -36px; width: 260px; color: rgba(213,194,180,.08); }
.hero-card__mark svg { width: 100%; height: auto; }
.hero-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hero-card .eyebrow { color: var(--sand); }
.hero-card .pill { background: rgba(241,233,225,.12); color: var(--cream); }
.hero-card .pill--ok { background: rgba(120,190,145,.2); color: #b5e2c4; }
.hero-card .pill--warn { background: rgba(213,194,180,.2); color: var(--sand); }
.hero-card__value { margin: 14px 0 4px; font-size: clamp(44px, 13vw, 64px); font-weight: 300; letter-spacing: -.025em; line-height: 1; }
.hero-card__sub { margin: 0; font-size: 14px; color: #c9bcb2; }
.hero-card__sub b { color: var(--cream); font-weight: 500; }
.hero-card__chart { margin-top: 18px; color: var(--sand); }
.hero-card__chart .bars { height: 74px; }
.hero-card__chart .bars text { fill: rgba(241,233,225,.45); }
.hero-card__chart .bars .bar.is-today { fill: var(--cream); }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpis .kpi { animation: fadeUp .8s var(--ease-out) both; }
.kpis .kpi:nth-child(2) { animation-delay: .05s; } .kpis .kpi:nth-child(3) { animation-delay: .1s; } .kpis .kpi:nth-child(4) { animation-delay: .15s; }
.kpis .kpi__value { font-size: 22px; }

.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px;
  background: var(--warn-bg); color: #6b4a14; font-size: 14px;
}
.notice svg { flex: none; width: 19px; height: 19px; margin-top: 1px; }

/* cupom */
.coupon {
  display: grid; gap: 14px; padding: 20px; border-radius: 22px;
  background: var(--paper); border: 1px dashed var(--sand-deep);
}
.coupon__codes { display: flex; flex-wrap: wrap; gap: 10px; }
.coupon__code {
  display: inline-flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 14px; background: var(--white);
  border: 1px solid var(--line);
}
.coupon__code b { font-family: var(--font-label); font-weight: 600; font-size: 18px; letter-spacing: .16em; }
.coupon__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.block { animation: fadeUp .8s var(--ease-out) both; }
.prod .row__meta { display: flex; justify-content: space-between; }

/* pedidos */
.order { display: block; padding: 0; border-bottom: 1px solid var(--line); }
.order:last-child { border-bottom: 0; }
.order summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 0; cursor: pointer; }
.order summary::-webkit-details-marker { display: none; }
.order__chev { width: 18px; height: 18px; color: var(--muted); transition: transform .4s var(--ease-out); flex: none; }
.order[open] .order__chev { transform: rotate(90deg); }
.order__body { padding: 0 0 16px; animation: fadeUp .45s var(--ease-out); }
.order__items { display: grid; gap: 10px; margin-bottom: 14px; }
.order__item { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.order__item .thumb { width: 40px; height: 50px; border-radius: 9px; }
.order__item small { display: block; color: var(--muted); font-size: 12.5px; }
.calc { display: grid; gap: 6px; padding: 14px; border-radius: 14px; background: var(--cream); font-size: 14px; }
.calc div { display: flex; justify-content: space-between; gap: 10px; }
.calc .strong { font-weight: 500; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; }
.calc .muted-row { color: var(--muted); }
.more-btn { width: 100%; margin-top: 8px; }

.rules { padding: 22px; border-radius: 22px; border: 1px solid var(--line); color: var(--cacau); font-size: 14px; }
.rules h3 { margin: 0 0 12px; font-size: 16px; font-weight: 400; color: var(--ink); }
.rules ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.rules b { font-weight: 500; color: var(--ink); }

.synced { margin: 4px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 8px; }
.synced::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }

/* conta */
.acct__head { display: flex; align-items: center; gap: 14px; }
.acct__head .avatar { width: 56px; height: 56px; font-size: 16px; }
.acct__list { display: grid; gap: 0; margin: 18px 0 8px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; }
.acct__list div { display: flex; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.acct__list div:last-child { border-bottom: 0; }
.acct__list span { color: var(--muted); }

/* instalar */
.install {
  position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 14px; border-radius: 20px; background: var(--ink); color: var(--cream); box-shadow: var(--shadow-lg);
  animation: sheetUp .6s var(--ease-out) both;
}
.install__icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--cream); color: var(--ink); }
.install__icon svg { width: 26px; }
.install__txt { flex: 1; display: grid; font-size: 13px; line-height: 1.35; color: #cfc3b9; }
.install__txt b { color: var(--cream); font-weight: 500; font-size: 14px; }
.install .icon-btn { border-color: rgba(241,233,225,.2); color: var(--cream); width: 34px; height: 34px; }
.install .btn { --bg: var(--cream); --fg: var(--ink); }

/* skeleton */
.is-loading-data .hero-card__value, .is-loading-data .kpi__value { color: transparent; background: rgba(241,233,225,.1); border-radius: 10px; }
.is-loading-data .kpi__value { background: rgba(22,18,15,.06); }

@media (min-width: 900px) {
  .pmain { padding-top: 24px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
}

.coupon__link { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.coupon__url { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--white); border: 1px solid var(--line); }
.coupon__url span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--cacau); }
.coupon__url .btn { flex: none; min-height: 38px; padding: 0 14px; }
.coupon__link small { font-size: 12.5px; color: var(--muted); }
.pmain > *, .coupon > * { min-width: 0; }
@media (max-width: 400px) { .coupon__url .btn span:not(.arrow) { display: none; } .coupon__url .btn { padding: 0 12px; } }
@media (max-width: 480px) { .kpis .kpi__value { font-size: clamp(17px, 5.2vw, 22px); } .kpis .kpi { padding: 16px 14px; } }
