/* =========================================================
   COMPONENTES DE PAINEL — portal da creator e admin
   ========================================================= */
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card__title { margin: 0; font-size: 18px; font-weight: 400; letter-spacing: .01em; }
.card__sub { font-size: 13px; color: var(--muted); }

/* KPIs */
.kpi { display: grid; gap: 6px; padding: 18px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); min-width: 0; }
.kpi__label { display: flex; align-items: center; gap: 8px; font-family: var(--font-label); font-weight: 600; font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.kpi__label svg { width: 15px; height: 15px; }
.kpi__value { font-size: 26px; font-weight: 400; letter-spacing: -.01em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi__foot { font-size: 12.5px; color: var(--muted); }
.trend { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.trend.up { color: var(--ok); }
.trend.down { color: var(--bad); }

/* status */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap; background: rgba(22,18,15,.06); color: var(--cacau);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill--ok { background: var(--ok-bg); color: var(--ok); }
.pill--warn { background: var(--warn-bg); color: var(--warn); }
.pill--bad { background: var(--bad-bg); color: var(--bad); }
.pill--dark { background: var(--ink); color: var(--cream); }
.pill--plain::before { display: none; }

/* listas */
.list { display: grid; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row__main { flex: 1; min-width: 0; }
.row__title { font-size: 15px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__meta { font-size: 13px; color: var(--muted); }
.row__end { text-align: right; flex: none; }
.row__value { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }

.thumb { flex: none; width: 52px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--sand); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.avatar {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--sand); color: var(--ink); font-family: var(--font-label); font-weight: 600; font-size: 12px; letter-spacing: .06em;
}
.avatar--dark { background: var(--ink); color: var(--cream); }

.meter { height: 4px; border-radius: 4px; background: rgba(22,18,15,.08); overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--ink); width: 0; transition: width 1.2s var(--ease-out); }

/* gráfico de barras */
.bars { width: 100%; height: 120px; overflow: visible; }
.bars .bar { fill: currentColor; transform-origin: bottom; transform-box: fill-box; animation: barUp .9s var(--ease-out) both; animation-delay: calc(var(--i) * 18ms); }
.bars .bar.is-zero { opacity: .2; }
.bars .bar.is-today { fill: var(--sand-deep); }
.bars text { font-family: var(--font-label); font-size: 7px; fill: var(--muted); }
@keyframes barUp { from { transform: scaleY(0); } }

/* sheet / modal */
.overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(22,18,15,.42);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .35s var(--ease) both;
}
.overlay.is-out { animation: fadeOut .3s var(--ease) both; }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 92svh; overflow: auto;
  background: var(--cream); border-radius: 26px 26px 0 0; padding: 26px 22px calc(26px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg); animation: sheetUp .55s var(--ease-out) both;
  overscroll-behavior: contain;
}
.overlay.is-out .sheet { animation: sheetDown .3s var(--ease) both; }
.sheet__grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: -12px auto 18px; }
.sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.sheet__title { margin: 0; font-size: 24px; font-weight: 300; line-height: 1.15; }
.sheet .stack { display: grid; gap: 16px; }
.sheet__foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
@media (min-width: 720px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { border-radius: 26px; max-width: 600px; padding: 32px; }
  .sheet--wide { max-width: 860px; }
  .sheet__grab { display: none; }
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
@keyframes sheetDown { to { transform: translateY(30px); opacity: 0; } }

/* vazio */
.empty { display: grid; justify-items: center; gap: 10px; padding: 36px 16px; text-align: center; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--sand-deep); }
.empty b { color: var(--ink); font-weight: 400; font-size: 17px; }

/* segmentado (abas) */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(22,18,15,.06); }
.seg button { border: 0; background: transparent; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; cursor: pointer; color: var(--cacau); transition: background .3s, color .3s; white-space: nowrap; }
.seg button.is-active { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(22,18,15,.12); }
.seg .count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: var(--cream); font-size: 10.5px; font-weight: 500; }

/* login */
.auth {
  min-height: 100svh; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--cream);
}
.auth__art { position: relative; overflow: hidden; background: var(--ink) center/cover; }
.auth__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(22,18,15,.1), rgba(22,18,15,.75)); }
.auth__art-copy { position: absolute; z-index: 1; left: 48px; right: 48px; bottom: 48px; color: var(--cream); }
.auth__art-copy p { font-size: clamp(28px, 2.6vw, 40px); font-weight: 300; line-height: 1.15; margin: 10px 0 0; }
.auth__panel { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 96px); }
.auth__box { width: 100%; max-width: 400px; margin: 0 auto; }
.auth__mark { width: 64px; margin-bottom: 36px; }
.auth__title { margin: 8px 0 8px; font-size: clamp(32px, 3vw, 44px); font-weight: 300; line-height: 1.08; }
.auth__lead { margin: 0 0 32px; color: var(--muted); }
.auth form { display: grid; gap: 18px; }
.auth__error { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--bad-bg); color: var(--bad); font-size: 14px; animation: shake .45s var(--ease); }
.auth__help { margin-top: 26px; font-size: 13.5px; color: var(--muted); }
.pw { position: relative; }
.pw .input { padding-right: 52px; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.pw button svg { width: 19px; height: 19px; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth__art { display: none; }
  .auth__panel { justify-content: flex-start; padding-top: max(64px, 12vh); }
}

/* splash de carregamento */
.splash { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: var(--cream); transition: opacity .5s var(--ease), visibility 0s .5s; }
.splash svg { width: 64px; }
.splash.is-out { opacity: 0; visibility: hidden; }
