/* ==========================================================================
   tdt-ui.css — o sistema visual APROVADO no prototipo, agora como folha do app.
   E copia fiel de __proto/proto.css (mesmas classes .ap-*), mais uma secao de
   ponte no fim para o markup que o bundle stitch-app gera em tempo de execucao.
   As paginas convertidas NAO carregam i9plus-phase8.css: era ele que mantinha o
   heroi roxo, os cards brancos e os paineis claros no tema escuro.
   ========================================================================== */
/* ============================================================
   PROTOTIPO — CSS compartilhado das telas do cliente.
   Nao e o app: arquivo isolado em /__proto para aprovar
   ESTRUTURA + duplo tema antes de tocar no i9plus-phase8.css.
   ============================================================ */

/* ---------- 1. TOKENS SEMANTICOS ---------- */
:root {
  --accent: #b01774;
  --accent-2: #e91e85;
  --accent-ink: #ffffff;

  --font: "Inter", system-ui, -apple-system, sans-serif;

  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 26px;
  --r-pill: 999px;

  --step-display: clamp(40px, 7vw, 56px);
  --step-h1: 22px;
  --step-h2: 19px;
  --step-body: 15px;
  --step-cap: 13px;
  --step-micro: 11.5px;

  --side-w: 264px;
  --rail-w: 340px;
  --shell: 1240px;
}

/* TEMA CLARO */
[data-theme="light"] {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f0f0f3;
  --border: rgba(17, 24, 39, 0.08);
  --text: #16161c;
  --text-muted: #6b7280;
  --text-faint: #9aa0ab;

  --hero-bg: radial-gradient(120% 140% at 85% 0%, #3b1140 0%, #17131f 55%, #101017 100%);
  --hero-text: #ffffff;
  --hero-muted: rgba(255, 255, 255, 0.62);
  --hero-line: rgba(255, 255, 255, 0.14);

  --shadow-1: 0 1px 2px rgba(16, 16, 23, 0.04), 0 8px 20px rgba(16, 16, 23, 0.05);
  --shadow-2: 0 2px 6px rgba(16, 16, 23, 0.06), 0 20px 44px rgba(16, 16, 23, 0.10);
  --shadow-hero: 0 24px 60px rgba(35, 10, 45, 0.28);
  --ring-track: rgba(255, 255, 255, 0.16);
  --dock-bg: rgba(20, 20, 27, 0.94);
  --dock-text: rgba(255, 255, 255, 0.55);

  /* Dataviz — slots categoricos validados p/ superficie #ffffff.
     (aqua e amarelo ficam abaixo de 3:1 => rotulo direto obrigatorio) */
  --c1: #2a78d6;
  --c2: #eb6834;
  --c3: #1baf7a;
  --c4: #eda100;
  --bar-idle: #dcdce2;
  --grid: #e8e8ec;
  --axis-ink: #898781;
  --good: #059669;
  --bad: #e11d48;
}

/* TEMA ESCURO — o heroi sobe de tom pra nao sumir no fundo */
[data-theme="dark"] {
  --bg: #0d0d11;
  --surface: #17171d;
  --surface-2: #1f1f27;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f3f3f5;
  --text-muted: #a1a1ab;
  --text-faint: #6f6f7a;

  --hero-bg: radial-gradient(120% 140% at 85% 0%, #4a1450 0%, #241830 52%, #1a1622 100%);
  --hero-text: #ffffff;
  --hero-muted: rgba(255, 255, 255, 0.66);
  --hero-line: rgba(255, 255, 255, 0.16);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 18px 40px rgba(0, 0, 0, 0.55);
  --shadow-hero: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(233, 30, 133, 0.18);
  --ring-track: rgba(255, 255, 255, 0.14);
  --dock-bg: rgba(28, 28, 36, 0.94);
  --dock-text: rgba(255, 255, 255, 0.55);

  /* Dataviz — mesmos hues, degraus escolhidos p/ superficie #17171d */
  --c1: #3987e5;
  --c2: #d95926;
  --c3: #199e70;
  --c4: #c98500;
  --bar-idle: #31313d;
  --grid: #2c2c2a;
  --axis-ink: #898781;
  --good: #4ade80;
  --bad: #fb7185;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--step-body);
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
  padding-bottom: 96px;
}
.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* ---------- 2. SHELL ---------- */
.ap-side { display: none; }
@media (min-width: 1100px) {
  .ap-side {
    position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40;
    display: flex; flex-direction: column; gap: 4px;
    background: var(--surface); border-right: 1px solid var(--border);
    padding: 22px 16px;
  }
  body { padding-left: var(--side-w); }
}
.ap-brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 20px; }
.ap-brand__mark {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto;
  background: linear-gradient(140deg, var(--accent-2), var(--accent));
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 6px 16px rgba(176, 23, 116, 0.32);
}
.ap-brand__name { font-weight: 800; font-size: 15.5px; letter-spacing: -0.2px; }
.ap-brand__sub { font-size: var(--step-micro); color: var(--text-faint); margin-top: 1px; }

.ap-side__cta {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; margin: 0 2px 18px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 14.5px;
  box-shadow: 0 10px 22px rgba(176, 23, 116, 0.28);
}
.ap-side__label {
  font-size: var(--step-micro); font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint); padding: 0 12px 8px;
}
.ap-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ap-nav__item {
  display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px;
  border-radius: var(--r-sm); color: var(--text-muted);
  font-size: 14.5px; font-weight: 600; transition: background 0.15s, color 0.15s;
}
.ap-nav__item .material-symbols-outlined { font-size: 22px; }
.ap-nav__item:hover { background: var(--surface-2); color: var(--text); }
.ap-nav__item.is-active { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 18px rgba(176,23,116,0.26); }
.ap-nav__badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-pill);
  background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700;
  display: grid; place-items: center;
}
.ap-nav__item.is-active .ap-nav__badge { background: rgba(255,255,255,0.24); }
.ap-side__foot {
  display: flex; align-items: center; gap: 10px; padding: 12px 10px 2px;
  border-top: 1px solid var(--border); margin-top: 8px;
}
.ap-side__avatar {
  width: 36px; height: 36px; border-radius: var(--r-pill); flex: 0 0 auto;
  background: linear-gradient(140deg, #6d28d9, #b01774); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.ap-side__who { font-size: 13.5px; font-weight: 700; line-height: 1.2; }
.ap-side__tier { font-size: var(--step-micro); color: var(--text-faint); }

.ap-top {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
}
.ap-top__in {
  width: min(var(--shell), 100%); margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 16px 16px;
}
@media (min-width: 1100px) { .ap-top__in { padding: 20px 28px; } }
.ap-top__back {
  width: 42px; height: 42px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: grid; place-items: center; flex: 0 0 auto;
}
.ap-top__hi { font-size: var(--step-h1); font-weight: 800; letter-spacing: -0.4px; line-height: 1.15; }
.ap-top__sub { font-size: var(--step-cap); color: var(--text-muted); margin-top: 2px; }
.ap-top__acts { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ap-iconbtn {
  width: 42px; height: 42px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
  display: grid; place-items: center; position: relative;
  transition: transform 0.12s ease, background 0.15s ease;
}
.ap-iconbtn:active { transform: scale(0.94); }
.ap-iconbtn__dot {
  position: absolute; top: 10px; right: 11px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-2); border: 2px solid var(--surface);
}

.ap-shell {
  width: min(var(--shell), 100%); margin: 0 auto;
  padding: 8px 16px 32px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px;
}
@media (min-width: 1100px) {
  .ap-shell { grid-template-columns: minmax(0, 1fr) var(--rail-w); gap: 26px; padding: 12px 28px 40px; align-items: start; }
  .ap-shell--single { grid-template-columns: minmax(0, 1fr); }
  .ap-shell--narrow { max-width: 760px; }
}
.ap-main { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.ap-rail { display: none; }
/* Rail que NAO pode sumir no mobile (ex.: resultado da leitura no balcao):
   no celular ele entra no fluxo, logo abaixo do conteudo principal. */
.ap-rail--always { display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 1100px) {
  .ap-rail { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 92px; }
}

/* ---------- 3. HEROI ---------- */
.ap-hero {
  position: relative; overflow: hidden;
  background: var(--hero-bg); color: var(--hero-text);
  border-radius: var(--r-lg); padding: 24px;
  box-shadow: var(--shadow-hero);
}
.ap-hero::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(233, 30, 133, 0.42), transparent 68%);
  pointer-events: none;
}
.ap-hero__grid { position: relative; display: flex; gap: 20px; align-items: flex-start; }
.ap-hero__left { flex: 1; min-width: 0; }
.ap-hero__label {
  font-size: var(--step-micro); font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--hero-muted);
}
.ap-hero__value {
  margin: 8px 0 0; font-size: var(--step-display); font-weight: 800;
  letter-spacing: -2px; line-height: 1;
}
.ap-hero__value small { font-size: 0.34em; font-weight: 600; letter-spacing: 0; margin-left: 8px; color: var(--hero-muted); }
.ap-hero__tier {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  padding: 7px 13px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.12); border: 1px solid var(--hero-line);
  font-size: var(--step-cap); font-weight: 700;
}
.ap-hero__tier .material-symbols-outlined { font-size: 16px; color: #f7c948; font-variation-settings: 'FILL' 1; }

.ap-ring { position: relative; width: 108px; height: 108px; flex: 0 0 auto; }
.ap-ring svg { transform: rotate(-90deg); }
.ap-ring__txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ap-ring__num { font-size: 21px; font-weight: 800; line-height: 1; }
.ap-ring__cap { font-size: 10.5px; color: var(--hero-muted); margin-top: 3px; letter-spacing: 0.04em; }
.ap-ring--ink .ap-ring__cap { color: var(--text-muted); }

.ap-hero__kpis { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.ap-kpi { background: rgba(255, 255, 255, 0.08); border: 1px solid var(--hero-line); border-radius: var(--r-sm); padding: 13px 14px; }
.ap-kpi__k { display: flex; align-items: center; gap: 6px; font-size: var(--step-micro); color: var(--hero-muted); }
.ap-kpi__k .material-symbols-outlined { font-size: 15px; }
.ap-kpi__v { font-size: 19px; font-weight: 800; margin-top: 5px; letter-spacing: -0.5px; }
.ap-kpi--in .ap-kpi__v { color: #4ade80; }
.ap-kpi--out .ap-kpi__v { color: #fb7185; }

/* Sparkline do heroi (serie unica => sem legenda, so rotulo de contexto) */
.ap-spark { position: relative; margin-top: 20px; }
.ap-spark__cap {
  display: flex; align-items: baseline; gap: 8px;
  font-size: var(--step-micro); color: var(--hero-muted); margin-bottom: 6px;
}
.ap-spark__cap b { color: #4ade80; font-size: 12.5px; }
.ap-spark svg { display: block; width: 100%; height: 62px; }

/* ---------- 4. ACOES RAPIDAS ---------- */
.ap-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ap-quick__i {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 16px 8px 13px; text-align: center; box-shadow: var(--shadow-1);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.ap-quick__i:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.ap-quick__ic { width: 46px; height: 46px; margin: 0 auto 9px; border-radius: var(--r-sm); display: grid; place-items: center; color: #fff; }
.ap-quick__ic--1 { background: linear-gradient(140deg, #e91e85, #b01774); }
.ap-quick__ic--2 { background: linear-gradient(140deg, #7c3aed, #4c1d95); }
.ap-quick__ic--3 { background: linear-gradient(140deg, #2563eb, #1e3a8a); }
.ap-quick__ic--4 { background: linear-gradient(140deg, #0d9488, #134e4a); }
.ap-quick__t { font-size: var(--step-cap); font-weight: 600; color: var(--text); }

/* ---------- 5. BUSCA + CHIPS ---------- */
.ap-search {
  display: flex; align-items: center; gap: 11px; height: 52px; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill);
  box-shadow: var(--shadow-1); color: var(--text-faint);
}
.ap-search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 14.5px; color: var(--text); font-family: inherit; }
.ap-search input::placeholder { color: var(--text-faint); }
.ap-chips { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.ap-chips::-webkit-scrollbar { display: none; }
.ap-chip {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  height: 40px; padding: 0 16px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13.5px; font-weight: 600; color: var(--text-muted);
}
.ap-chip .material-symbols-outlined { font-size: 18px; }
.ap-chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 18px rgba(176,23,116,0.26); }

/* ---------- 6. SECOES / CARDS ---------- */
.ap-sec__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.ap-sec__title { font-size: var(--step-h2); font-weight: 800; letter-spacing: -0.3px; margin: 0; }
.ap-sec__link { margin-left: auto; font-size: var(--step-cap); font-weight: 700; color: var(--accent); }
[data-theme="dark"] .ap-sec__link { color: #f472b6; }

.ap-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 640px) { .ap-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ap-card {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-1); transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.ap-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.ap-card__av { width: 56px; height: 56px; border-radius: var(--r-sm); flex: 0 0 auto; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 17px; }
.ap-card__b { min-width: 0; flex: 1; }
.ap-card__n { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-card__c { font-size: var(--step-cap); color: var(--text-muted); margin-top: 2px; }
.ap-card__p {
  flex: 0 0 auto; padding: 7px 12px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent); font-size: var(--step-cap); font-weight: 800;
}
[data-theme="dark"] .ap-card__p { color: #f472b6; }

.ap-scroll { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.ap-scroll::-webkit-scrollbar { display: none; }
.ap-disc { flex: 0 0 236px; scroll-snap-align: start; }
.ap-disc__img { position: relative; height: 148px; border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-1); }
.ap-disc__img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.72)); }
.ap-disc__tag {
  position: absolute; top: 10px; left: 10px; z-index: 2; padding: 5px 10px; border-radius: var(--r-pill);
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 5px;
}
.ap-disc__tag .material-symbols-outlined { font-size: 13px; color: #f7c948; font-variation-settings: 'FILL' 1; }
.ap-disc__over { position: absolute; left: 12px; right: 12px; bottom: 11px; z-index: 2; color: #fff; }
.ap-disc__n { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.ap-disc__m { font-size: 12px; opacity: 0.82; margin-top: 2px; }

/* ---------- 7. PAINEIS / RAIL ---------- */
.ap-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; box-shadow: var(--shadow-1); }
.ap-panel__t { font-size: var(--step-cap); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 14px; }

.ap-qr { position: relative; overflow: hidden; border-radius: var(--r-md); padding: 20px; background: var(--hero-bg); color: #fff; box-shadow: var(--shadow-hero); }
.ap-qr::after { content: ""; position: absolute; left: -40px; bottom: -70px; width: 200px; height: 200px; background: radial-gradient(circle, rgba(233,30,133,0.38), transparent 70%); }
.ap-qr__top { position: relative; display: flex; align-items: center; justify-content: space-between; font-size: var(--step-micro); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hero-muted); }
.ap-qr__code { position: relative; width: 132px; height: 132px; margin: 16px auto 14px; border-radius: var(--r-sm); background: #fff; padding: 9px; }
.ap-qr__code--lg { width: 210px; height: 210px; padding: 12px; }
.ap-qr__code i {
  display: block; width: 100%; height: 100%;
  background-image:
    linear-gradient(90deg, #12121a 25%, transparent 25%, transparent 50%, #12121a 50%, #12121a 75%, transparent 75%),
    linear-gradient(0deg, #12121a 25%, transparent 25%, transparent 50%, #12121a 50%, #12121a 75%, transparent 75%);
  background-size: 14px 14px; opacity: 0.9;
}
.ap-qr__who { position: relative; text-align: center; }
.ap-qr__name { font-size: 15px; font-weight: 700; }
.ap-qr__hint { font-size: 12px; color: var(--hero-muted); margin-top: 3px; }

.ap-lv { display: flex; flex-direction: column; gap: 14px; }
.ap-lv__row { display: grid; gap: 7px; }
.ap-lv__top { display: flex; align-items: center; font-size: var(--step-cap); }
.ap-lv__n { font-weight: 600; color: var(--text-muted); }
.ap-lv__v { margin-left: auto; font-weight: 800; }
.ap-lv__bar { height: 8px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.ap-lv__fill { height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, #e91e85, #b01774); }

.ap-tx { display: flex; flex-direction: column; }
.ap-tx__r { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.ap-tx__r:last-child { border-bottom: 0; padding-bottom: 0; }
.ap-tx__ic { width: 38px; height: 38px; border-radius: var(--r-pill); flex: 0 0 auto; display: grid; place-items: center; background: var(--surface-2); color: var(--text-muted); }
.ap-tx__ic .material-symbols-outlined { font-size: 19px; }
.ap-tx__b { min-width: 0; flex: 1; }
.ap-tx__t { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-tx__d { font-size: var(--step-micro); color: var(--text-faint); margin-top: 2px; }
.ap-tx__v { font-size: 14px; font-weight: 800; }
.ap-tx__v.is-in { color: var(--good); }
.ap-tx__v.is-out { color: var(--bad); }

.ap-mobile-only { display: block; }
@media (min-width: 1100px) { .ap-mobile-only { display: none; } }

/* ---------- 8. DOCK MOBILE ---------- */
.ap-dock {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 50;
  width: min(430px, calc(100% - 24px));
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: var(--r-pill);
  background: var(--dock-bg); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 18px 40px rgba(0,0,0,0.34);
}
@media (min-width: 1100px) { .ap-dock { display: none; } }
.ap-dock__i { display: grid; place-items: center; gap: 3px; width: 58px; color: var(--dock-text); }
.ap-dock__i .material-symbols-outlined { font-size: 22px; }
.ap-dock__i span:last-child { font-size: 10px; font-weight: 600; }
.ap-dock__i.is-active { color: #fff; }
.ap-dock__qr {
  width: 54px; height: 54px; border-radius: var(--r-pill); margin-top: -22px;
  background: linear-gradient(140deg, #e91e85, #b01774); color: #fff;
  display: grid; place-items: center; border: 4px solid var(--dock-bg);
  box-shadow: 0 10px 22px rgba(176,23,116,0.5);
}
.ap-dock__qr .material-symbols-outlined { font-size: 25px; }

/* ---------- 9. BOTOES / CONTROLES ---------- */
.ap-themebtn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px;
  border-radius: var(--r-pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 13px; font-weight: 700; cursor: pointer;
}
.ap-themebtn .material-symbols-outlined { font-size: 18px; }

.ap-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px; border-radius: var(--r-sm); border: 0; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 14.5px; font-weight: 700;
  box-shadow: 0 10px 22px rgba(176,23,116,0.28); width: 100%;
}
.ap-btn--ghost { background: var(--surface-2); color: var(--text); box-shadow: none; }
.ap-btn--sm { height: 40px; font-size: 13.5px; padding: 0 14px; width: auto; }

/* Segmentado (periodo) */
.ap-seg { display: inline-flex; gap: 3px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); }
.ap-seg__i {
  border: 0; background: transparent; cursor: pointer; color: var(--text-muted);
  height: 34px; padding: 0 15px; border-radius: var(--r-pill); font-size: 13px; font-weight: 700;
}
.ap-seg__i.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* Toggle */
.ap-switch { width: 46px; height: 27px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border); position: relative; cursor: pointer; flex: 0 0 auto; }
.ap-switch i { position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.25); transition: left 0.16s ease; }
.ap-switch.is-on { background: var(--accent); border-color: var(--accent); }
.ap-switch.is-on i { left: 21px; }

/* Linha de configuracao */
.ap-row { display: flex; align-items: center; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.ap-row:last-child { border-bottom: 0; }
.ap-row__ic { width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-muted); display: grid; place-items: center; flex: 0 0 auto; }
.ap-row__b { flex: 1; min-width: 0; }
.ap-row__t { font-size: 14.5px; font-weight: 600; }
.ap-row__d { font-size: var(--step-micro); color: var(--text-faint); margin-top: 2px; }

/* ---------- 10. GRAFICOS ---------- */
.ap-chart__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.ap-chart__t { font-size: 15px; font-weight: 700; margin: 0; }
.ap-chart__s { font-size: var(--step-micro); color: var(--text-faint); margin-top: 3px; }
.ap-chart__act { margin-left: auto; }

/* Barras verticais — enfase: mes atual em accent, resto recessivo.
   Linha de base e hairline solida; rotulo de valor so no destaque e no hover. */
.ap-bars {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px;
  align-items: end; margin-top: 20px; border-bottom: 1px solid var(--grid);
}
.ap-bars__c { display: grid; align-content: end; justify-items: center; gap: 7px; cursor: default; }
.ap-bars__v { font-size: var(--step-micro); font-weight: 800; color: var(--text-muted); opacity: 0; transition: opacity 0.12s ease; }
.ap-bars__c.is-on .ap-bars__v, .ap-bars__c:hover .ap-bars__v { opacity: 1; }
.ap-bars__b { width: 100%; max-width: 38px; border-radius: 4px 4px 0 0; background: var(--bar-idle); transition: background 0.15s ease; }
.ap-bars__c.is-on .ap-bars__b { background: linear-gradient(180deg, #e91e85, #b01774); }
.ap-bars__c:hover .ap-bars__b { background: color-mix(in srgb, var(--accent) 45%, var(--bar-idle)); }
.ap-bars__c.is-on:hover .ap-bars__b { background: linear-gradient(180deg, #e91e85, #b01774); }
.ap-xaxis { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; margin-top: 9px; }
.ap-xaxis span { font-size: var(--step-micro); color: var(--axis-ink); text-align: center; }

/* Parte-do-todo: barra empilhada horizontal + rotulo direto (relief rule) */
.ap-stack { display: flex; gap: 2px; height: 16px; margin: 4px 0 16px; }
.ap-stack__s:first-child { border-radius: var(--r-pill) 0 0 var(--r-pill); }
.ap-stack__s:last-child { border-radius: 0 var(--r-pill) var(--r-pill) 0; }
.ap-legend { display: grid; gap: 11px; }
.ap-legend__r { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.ap-legend__d { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.ap-legend__n { color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-legend__v { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.ap-legend__p { width: 46px; text-align: right; color: var(--text-faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* Tabela equivalente (todo grafico tem gemea acessivel) */
.ap-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 14px; }
.ap-table th, .ap-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); }
.ap-table th { font-size: var(--step-micro); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); font-weight: 700; }
.ap-table td:last-child, .ap-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.is-hidden { display: none !important; }

/* ---------- 11. BENEFICIOS ---------- */
.ap-bens { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 700px) { .ap-bens { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ap-ben { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-1); display: flex; flex-direction: column; }
.ap-ben__img { position: relative; height: 132px; }
.ap-ben__badge {
  position: absolute; top: 12px; left: 12px; padding: 6px 11px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 800; color: #fff; background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  display: inline-flex; align-items: center; gap: 6px;
}
.ap-ben__badge--ok { background: #059669; }
.ap-ben__badge--soon { background: #d97706; }
.ap-ben__b { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ap-ben__t { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.ap-ben__d { font-size: var(--step-cap); color: var(--text-muted); line-height: 1.5; flex: 1; }
.ap-ben__meta { display: flex; align-items: center; gap: 8px; font-size: var(--step-micro); color: var(--text-faint); }
.ap-ben__meta .material-symbols-outlined { font-size: 15px; }

/* ---------- 12. DETALHE DO PARCEIRO ---------- */
.ap-cover { position: relative; height: 190px; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.ap-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,0.78)); }
.ap-cover__in { position: absolute; left: 20px; right: 20px; bottom: 16px; z-index: 2; color: #fff; display: flex; align-items: flex-end; gap: 14px; }
.ap-cover__av { width: 66px; height: 66px; border-radius: var(--r-sm); border: 3px solid rgba(255,255,255,0.9); display: grid; place-items: center; font-weight: 800; font-size: 20px; flex: 0 0 auto; }
.ap-cover__n { font-size: 21px; font-weight: 800; letter-spacing: -0.4px; }
.ap-cover__m { font-size: 13px; opacity: 0.88; margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.ap-cover__m .material-symbols-outlined { font-size: 15px; color: #f7c948; font-variation-settings: 'FILL' 1; }

.ap-fid { display: flex; align-items: center; gap: 18px; }
.ap-fid__b { flex: 1; min-width: 0; }
.ap-fid__t { font-size: 15px; font-weight: 700; }
.ap-fid__d { font-size: var(--step-cap); color: var(--text-muted); margin-top: 4px; line-height: 1.5; }
.ap-stamps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.ap-stamp { aspect-ratio: 1; border-radius: var(--r-xs); background: var(--surface-2); display: grid; place-items: center; color: var(--text-faint); font-size: 12px; font-weight: 700; }
.ap-stamp.is-on { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.ap-stamp.is-on .material-symbols-outlined { font-size: 18px; }
[data-theme="dark"] .ap-stamp.is-on { color: #f472b6; }

/* ---------- 13. PERFIL ---------- */
.ap-prof { display: flex; align-items: center; gap: 16px; }
.ap-prof__av { width: 74px; height: 74px; border-radius: var(--r-pill); background: linear-gradient(140deg, #6d28d9, #b01774); color: #fff; display: grid; place-items: center; font-size: 25px; font-weight: 800; flex: 0 0 auto; }
.ap-prof__n { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; }
.ap-prof__e { font-size: var(--step-cap); color: var(--text-muted); margin-top: 3px; }
.ap-prof__tier { display: inline-flex; align-items: center; gap: 6px; margin-top: 9px; padding: 6px 12px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-size: 12.5px; font-weight: 800; }
[data-theme="dark"] .ap-prof__tier { color: #f472b6; }
.ap-prof__tier .material-symbols-outlined { font-size: 16px; }

.ap-note { width: min(var(--shell), 100%); margin: 0 auto; padding: 18px 16px 0; font-size: 12.5px; color: var(--text-faint); line-height: 1.6; }
@media (min-width: 1100px) { .ap-note { padding: 18px 28px 0; } }

/* ============================================================
   14. AUTENTICACAO (entrar / criar conta / escolher perfil)
   Desktop: painel de marca escuro a esquerda + formulario a direita.
   Mobile: a marca vira cabecalho compacto e o formulario ocupa a tela.
   ============================================================ */
/* As duas colunas precisam esticar ate o rodape; sem isto a marca acaba no
   meio da tela e sobra uma faixa preta embaixo. */
/* ATENCAO: no celular as duas secoes viram LINHAS. Com grid-auto-rows de 100vh
   cada uma, a marca sozinha ocupava a tela inteira e o formulario de login
   nascia abaixo da dobra — quem abria /entrar.html no telefone via so uma tela
   roxa. No telefone a marca e um cabecalho de altura automatica e o formulario
   fica com o resto; a divisao em duas colunas so vale no desktop. */
body.ap-authbody {
  padding: 0; display: grid; min-height: 100dvh;
  grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr;
  align-items: stretch;
}
body.ap-authbody > section { min-height: 0; }
@media (min-width: 1000px) {
  body.ap-authbody { grid-template-columns: 1.05fr 1fr; grid-template-rows: minmax(100vh, auto); }
  body.ap-authbody > section { min-height: 100%; }
}

.ap-auth__brand {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(120% 120% at 20% 10%, #4a1450 0%, #241830 55%, #14111c 100%);
  padding: 30px 26px; display: flex; flex-direction: column;
}
@media (min-width: 1000px) { .ap-auth__brand { padding: 48px 56px; } }
.ap-auth__brand::after {
  content: ""; position: absolute; right: -120px; bottom: -140px; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(233,30,133,0.38), transparent 68%);
}
.ap-auth__logo { position: relative; display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 16px; }
.ap-auth__claim { position: relative; margin-top: auto; padding-top: 30px; }
.ap-auth__claim h1 { font-size: clamp(25px, 3.4vw, 40px); font-weight: 800; letter-spacing: -1px; line-height: 1.14; margin: 0; }
.ap-auth__claim p { margin: 14px 0 0; font-size: 15px; line-height: 1.6; color: rgba(255,255,255,0.72); max-width: 46ch; }
.ap-auth__proof { position: relative; display: flex; gap: 26px; margin-top: 28px; flex-wrap: wrap; }
.ap-auth__proof b { display: block; font-size: 23px; font-weight: 800; letter-spacing: -0.6px; }
.ap-auth__proof span { font-size: 12px; color: rgba(255,255,255,0.62); }
/* No telefone a marca e so um cabecalho: nada de prova social nem respiro de
   desktop empurrando o formulario para fora da tela. */
@media (max-width: 999px) {
  .ap-auth__brand { padding: 20px 20px 24px; }
  .ap-auth__claim { margin-top: 18px; padding-top: 0; }
  .ap-auth__claim h1 { font-size: 24px; }
  .ap-auth__claim p { margin-top: 8px; font-size: 13.5px; }
  .ap-auth__proof { display: none; }
}

.ap-auth__form { position: relative; display: flex; align-items: center; justify-content: center; padding: 28px 20px 40px; background: var(--bg); }
.ap-auth__box { width: 100%; max-width: 420px; }
.ap-auth__t { font-size: 25px; font-weight: 800; letter-spacing: -0.6px; margin: 0; }
.ap-auth__s { font-size: 14px; color: var(--text-muted); margin: 7px 0 26px; line-height: 1.55; }
.ap-auth__foot { margin-top: 22px; font-size: 13.5px; color: var(--text-muted); text-align: center; }
.ap-auth__theme { position: absolute; top: 16px; right: 16px; z-index: 5; }

.ap-field { display: grid; gap: 7px; margin-bottom: 15px; }
.ap-field__l { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.ap-input {
  height: 52px; padding: 0 15px; border-radius: var(--r-sm); font-size: 15px; font-family: inherit;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease; width: 100%;
}
.ap-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.ap-input::placeholder { color: var(--text-faint); }
.ap-link { color: var(--accent); font-weight: 700; }
[data-theme="dark"] .ap-link { color: #f472b6; }
.ap-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--text-faint); font-size: 12.5px; }
.ap-divider::before, .ap-divider::after { content: ""; height: 1px; background: var(--border); flex: 1; }

.ap-choice { display: grid; gap: 12px; }
.ap-choice__i {
  display: flex; align-items: center; gap: 14px; padding: 16px; width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  cursor: pointer; text-align: left; transition: border-color 0.15s ease, transform 0.12s ease;
}
.ap-choice__i:hover { transform: translateY(-2px); }
.ap-choice__i.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.ap-choice__ic { width: 46px; height: 46px; border-radius: var(--r-sm); display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.ap-choice__t { font-size: 15px; font-weight: 700; color: var(--text); }
.ap-choice__d { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }

/* ============================================================
   15. SCANNER (cliente le o QR da empresa; empresa le o do cliente)
   ============================================================ */
.ap-scan { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #0b0b10; aspect-ratio: 3 / 4; }
@media (min-width: 700px) { .ap-scan { aspect-ratio: 4 / 3; } }
.ap-scan__feed { position: absolute; inset: 0; background: repeating-linear-gradient(115deg, #1b1b24 0 22px, #15151d 22px 44px); }
.ap-scan__hole {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: min(64%, 250px); aspect-ratio: 1; border-radius: 22px;
  box-shadow: 0 0 0 9999px rgba(6, 6, 10, 0.66);
}
.ap-scan__c { position: absolute; width: 34px; height: 34px; border: 4px solid var(--accent-2); }
.ap-scan__c--tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 18px 0 0 0; }
.ap-scan__c--tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-radius: 0 18px 0 0; }
.ap-scan__c--bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 18px; }
.ap-scan__c--br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 18px 0; }
.ap-scan__line {
  position: absolute; left: 6%; right: 6%; top: 20%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
  animation: apScan 2.4s ease-in-out infinite;
}
@keyframes apScan { 0%, 100% { top: 14%; } 50% { top: 78%; } }
@media (prefers-reduced-motion: reduce) { .ap-scan__line { animation: none; } }
.ap-scan__hint {
  position: absolute; left: 20px; right: 20px; bottom: 22px; text-align: center; color: #fff;
  font-size: 14px; line-height: 1.5; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); z-index: 3;
}
.ap-scan__tools { position: absolute; top: 16px; right: 16px; display: grid; gap: 10px; z-index: 3; }
.ap-scan__tool {
  width: 44px; height: 44px; border-radius: var(--r-pill); border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.16); color: #fff; backdrop-filter: blur(8px);
  display: grid; place-items: center;
}

/* ============================================================
   16. TABELA DENSA / PAINEIS (empresa e admin)
   ============================================================ */
.ap-tablewrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.ap-dt { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }
.ap-dt th {
  text-align: left; padding: 11px 12px; font-size: var(--step-micro); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.ap-dt td { padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ap-dt tr:last-child td { border-bottom: 0; }
.ap-dt tbody tr:hover { background: var(--surface-2); }
.ap-dt__who { display: flex; align-items: center; gap: 11px; }
.ap-dt__av { width: 36px; height: 36px; border-radius: var(--r-xs); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12.5px; flex: 0 0 auto; }
.ap-dt__n { font-weight: 700; }
.ap-dt__m { font-size: var(--step-micro); color: var(--text-faint); margin-top: 2px; }
.ap-dt__num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

.ap-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; }
.ap-pill .material-symbols-outlined { font-size: 14px; }
.ap-pill--ok { background: color-mix(in srgb, #059669 14%, transparent); color: #047857; }
.ap-pill--warn { background: color-mix(in srgb, #d97706 16%, transparent); color: #b45309; }
.ap-pill--bad { background: color-mix(in srgb, #e11d48 14%, transparent); color: #be123c; }
.ap-pill--info { background: color-mix(in srgb, #2563eb 14%, transparent); color: #1d4ed8; }
[data-theme="dark"] .ap-pill--ok { color: #4ade80; }
[data-theme="dark"] .ap-pill--warn { color: #fbbf24; }
[data-theme="dark"] .ap-pill--bad { color: #fb7185; }
[data-theme="dark"] .ap-pill--info { color: #60a5fa; }

.ap-kgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 800px) { .ap-kgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ap-k { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; box-shadow: var(--shadow-1); }
.ap-k__l { display: flex; align-items: center; gap: 7px; font-size: var(--step-micro); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.ap-k__l .material-symbols-outlined { font-size: 16px; }
.ap-k__v { font-size: 27px; font-weight: 800; letter-spacing: -1px; margin-top: 9px; }
.ap-k__d { font-size: 12.5px; font-weight: 700; margin-top: 5px; }
.ap-k__d.is-up { color: var(--good); }
.ap-k__d.is-down { color: var(--bad); }
.ap-k__d span { color: var(--text-faint); font-weight: 500; }

.ap-queue__r { display: flex; align-items: center; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ap-queue__r:last-child { border-bottom: 0; }
.ap-queue__acts { margin-left: auto; display: flex; gap: 8px; }
.ap-mini {
  height: 36px; padding: 0 13px; border-radius: var(--r-xs); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 13px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.ap-mini .material-symbols-outlined { font-size: 17px; }
.ap-mini--ok { background: #059669; border-color: #059669; color: #fff; }
.ap-mini--bad { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }

/* ============================================================
   17. TEXTO LONGO (termos, politicas) e telas de resultado
   ============================================================ */
.ap-prose { max-width: 68ch; }
.ap-prose h2 { font-size: 19px; font-weight: 800; letter-spacing: -0.3px; margin: 34px 0 10px; scroll-margin-top: 96px; }
.ap-prose h2:first-child { margin-top: 0; }
.ap-prose h3 { font-size: 15.5px; font-weight: 700; margin: 22px 0 8px; }
.ap-prose p, .ap-prose li { font-size: 14.5px; line-height: 1.7; color: var(--text-muted); }
.ap-prose p { margin: 0 0 12px; }
.ap-prose ul { margin: 0 0 14px; padding-left: 20px; }
.ap-prose li { margin-bottom: 7px; }
.ap-prose strong { color: var(--text); }
.ap-toc { display: grid; gap: 2px; }
.ap-toc a { padding: 9px 12px; border-radius: var(--r-xs); font-size: 13.5px; color: var(--text-muted); font-weight: 600; }
.ap-toc a:hover { background: var(--surface-2); color: var(--text); }
.ap-toc a.is-active { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
[data-theme="dark"] .ap-toc a.is-active { color: #f472b6; }

/* Tela de resultado (resgate validado, erro, vinculo feito) */
.ap-result { text-align: center; padding: 8px 0 4px; }
.ap-result__ic {
  width: 92px; height: 92px; border-radius: 50%; margin: 0 auto 20px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, #10b981, #047857);
  box-shadow: 0 18px 40px rgba(5, 150, 105, 0.35);
}
.ap-result__ic .material-symbols-outlined { font-size: 46px; font-variation-settings: 'FILL' 1; }
.ap-result__ic--bad { background: linear-gradient(140deg, #fb7185, #be123c); box-shadow: 0 18px 40px rgba(225, 29, 72, 0.32); }
.ap-result__t { font-size: 25px; font-weight: 800; letter-spacing: -0.6px; margin: 0; }
.ap-result__s { font-size: 14.5px; color: var(--text-muted); margin: 9px 0 0; line-height: 1.6; }
.ap-code {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; padding: 12px 18px;
  border-radius: var(--r-sm); background: var(--surface-2); border: 1px dashed var(--border);
  font-size: 16px; font-weight: 800; letter-spacing: 3px;
}

/* Estado vazio */
.ap-empty { text-align: center; padding: 30px 20px; }
.ap-empty__ic { width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-faint); }
.ap-empty__t { font-size: 15.5px; font-weight: 700; }
.ap-empty__d { font-size: 13.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.55; }

/* ==========================================================================
   PONTE COM O BUNDLE
   O stitch-app gera listas e cartoes com classes proprias (.tdt-row,
   .tdt-feat-card, .tdt-tag) e alterna utilitarios (.hidden, .bg-primary).
   Aqui essas classes recebem o mesmo visual dos componentes aprovados, para a
   tela renderizada pelo JS ficar identica ao prototipo.
   ========================================================================== */

.hidden { display: none; }

/* Lista de empresas vinculadas -> cartao .ap-card */
.tdt-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 640px) { .tdt-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tdt-row {
  display: flex; align-items: center; gap: 14px; padding: 14px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-1); color: var(--text);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.tdt-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.tdt-row__img {
  width: 56px; height: 56px; flex: 0 0 auto; border-radius: var(--r-sm);
  object-fit: cover; background: var(--surface-2);
}
.tdt-row__body { flex: 1; min-width: 0; }
.tdt-row__name {
  font-size: 15px; font-weight: 700; letter-spacing: -0.2px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tdt-row__meta { margin-top: 2px; font-size: var(--step-cap); color: var(--text-muted); display: flex; gap: 6px; align-items: center; }
.tdt-row__star { color: #f0a500; font-weight: 700; display: inline-flex; align-items: center; gap: 2px; }
.tdt-row__star .material-symbols-outlined { font-size: 15px; }
.tdt-row__tags { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 6px; }
.tdt-row__chevron { color: var(--text-faint); }
.tdt-tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px;
  border-radius: var(--r-pill); font-size: 12.5px; font-weight: 800;
  background: var(--surface-2); color: var(--text-muted);
}
.tdt-tag .material-symbols-outlined { font-size: 14px; }
.tdt-tag--points { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
[data-theme="dark"] .tdt-tag--points { color: #f472b6; }

/* Carrossel "Descubra empresas" -> cartao .ap-disc */
.tdt-feat-scroll {
  display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 8px;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.tdt-feat-scroll::-webkit-scrollbar { display: none; }
.tdt-feat-card {
  flex: 0 0 236px; scroll-snap-align: start; text-decoration: none;
  border-radius: var(--r-md); overflow: hidden; position: relative;
  box-shadow: var(--shadow-1); background: var(--surface); color: var(--text);
}
.tdt-feat-card__img { position: relative; width: 100%; height: 148px; background: var(--surface-2); }
.tdt-feat-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tdt-feat-card__img::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.72));
}
.tdt-feat-card__badge {
  position: absolute; top: 10px; left: 10px; z-index: 2; padding: 5px 10px;
  border-radius: var(--r-pill); background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  color: #fff; font-size: 11px; font-weight: 700;
}
.tdt-feat-card__body { position: absolute; left: 12px; right: 12px; bottom: 11px; z-index: 2; color: #fff; }
.tdt-feat-card__name { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.tdt-feat-card__meta { font-size: 12px; opacity: 0.86; margin-top: 2px; display: flex; gap: 6px; align-items: center; }
.tdt-feat-card__star { display: inline-flex; align-items: center; gap: 3px; color: #f7c948; font-weight: 800; }
.tdt-feat-card__star .material-symbols-outlined { font-size: 14px; }

/* Esqueletos de carregamento */
.tdt-skel-row { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.tdt-skel-box { border-radius: 10px; background: var(--surface-2); }
.tdt-empty {
  text-align: center; padding: 26px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text-muted); font-size: 13.5px; line-height: 1.55;
}
.tdt-empty__icon {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 12px;
  display: grid; place-items: center; background: var(--surface-2); color: var(--text-faint);
}

/* Filtro ativo marcado pelo bundle com a classe utilitaria bg-primary */
.ap-chip.bg-primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Shell injetado pelo bundle: sidebar (desktop) e dock (mobile).
   Recebem exatamente o visual aprovado no prototipo. */
.tdt-sidebar { display: none; }
@media (min-width: 1100px) {
  .tdt-sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40;
    display: flex; flex-direction: column; gap: 4px;
    background: var(--surface); border-right: 1px solid var(--border); padding: 22px 16px;
  }
  body.tdt-has-sidebar { padding-left: var(--side-w); }
}
.tdt-sidebar__brand {
  display: flex; align-items: center; gap: 11px; padding: 4px 10px 20px;
  text-decoration: none; color: var(--text); font-weight: 800; font-size: 15.5px;
}
.tdt-sidebar__brand img { width: 38px; height: 38px; border-radius: 12px; object-fit: contain; }
.tdt-sidebar__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.tdt-sidebar__link {
  display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px;
  border-radius: var(--r-sm); text-decoration: none; color: var(--text-muted);
  font-size: 14.5px; font-weight: 600; transition: background 0.15s, color 0.15s;
}
.tdt-sidebar__link .material-symbols-outlined { font-size: 22px; }
.tdt-sidebar__link:hover { background: var(--surface-2); color: var(--text); }
.tdt-sidebar__link.is-active {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 8px 18px rgba(176, 23, 116, 0.26);
}
.tdt-sidebar__link.is-active .material-symbols-outlined { color: #fff; }
.tdt-sidebar__cta {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; margin-top: 12px; border-radius: var(--r-sm);
  background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 14.5px; box-shadow: 0 10px 22px rgba(176, 23, 116, 0.28);
}

.app-mobile-dock {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); z-index: 60;
  width: min(430px, calc(100% - 24px));
  padding: 8px 10px; border-radius: var(--r-pill);
  background: var(--dock-bg); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}
@media (min-width: 1100px) { body.tdt-has-sidebar .app-mobile-dock { display: none; } }
.app-mobile-dock__inner { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.app-mobile-dock__item {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 48px; border-radius: var(--r-pill); text-decoration: none; color: var(--dock-text);
}
.app-mobile-dock__item-icon { display: grid; place-items: center; width: 30px; height: 30px; }
.app-mobile-dock__item-label { font-size: 9.5px; font-weight: 600; }
.app-mobile-dock__item--active { color: #fff; background: rgba(255, 255, 255, 0.14); }
.app-mobile-dock__item--active .app-mobile-dock__item-icon .material-symbols-outlined { color: #fff; }

/* Ordem da sidebar injetada: marca, CTA, itens (o bundle emite o CTA por ultimo) */
.tdt-sidebar__brand { order: -2; }
.tdt-sidebar__cta { order: -1; margin: 0 0 18px; }
.tdt-sidebar__nav { order: 0; }

/* O bundle usa .hidden para esconder skeleton, vazios e secoes.
   Precisa vencer o display:grid/flex dos containers. Esta folha nao e usada em
   pagina com Tailwind, entao nao ha risco de quebrar `hidden lg:flex`. */
/* ATENCAO: `hidden lg:flex` e usado pelas sidebars. Se .hidden levar
   !important sem excecao, a barra lateral nunca aparece no desktop. */
.hidden:not([class*="lg\:"]) { display: none !important; }
.hidden[class*="lg\:"] { display: none; }

/* O atributo `hidden` (nao a classe) esconde botoes em detalhe_do_parceiro e
   nas telas do admin. Quem garantia isso era o preflight do Tailwind; sem ele,
   "Vincular", "Como chegar" e "Ligar" apareciam sempre. */
[hidden] { display: none !important; }

/* Barra "Instalar o aplicativo" injetada pelo bundle */
.tdt-install-bar {
  display: flex; align-items: center; gap: 12px;
  width: min(var(--shell), calc(100% - 32px)); margin: 14px auto 0; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-1);
}
.tdt-install-bar__icon {
  width: 40px; height: 40px; border-radius: var(--r-sm); flex: 0 0 auto;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
}
.tdt-install-bar__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tdt-install-bar__text b { font-size: 14px; font-weight: 700; color: var(--text); }
.tdt-install-bar__text small { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tdt-install-bar__btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit; text-align: left;
  color: var(--text);
}
.tdt-install-bar__chevron { color: var(--text-faint); flex: 0 0 auto; }
.tdt-install-bar__close {
  flex: 0 0 auto; width: 34px; height: 34px; border: 0; cursor: pointer; border-radius: 50%;
  background: transparent; color: var(--text-faint); display: grid; place-items: center;
}

/* Folha de atalhos (mobile sheet) injetada pelo bundle */
.app-mobile-sheet-backdrop {
  position: fixed; inset: 0; z-index: 70; display: none;
  background: rgba(6, 6, 10, 0.55); backdrop-filter: blur(4px);
}
.app-mobile-sheet-backdrop.is-open { display: block; }
@media (min-width: 1100px) { .app-mobile-sheet-backdrop { display: none !important; } }
.app-mobile-sheet {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 71;
  width: min(520px, 100%); max-height: 84vh; overflow-y: auto;
  background: var(--surface); color: var(--text);
  border-radius: var(--r-lg) var(--r-lg) 0 0; border: 1px solid var(--border);
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.35);
}
.app-mobile-sheet h2 { font-size: 19px; font-weight: 800; letter-spacing: -0.3px; margin: 6px 0 0; }
.app-mobile-sheet p { color: var(--text-muted); }


/* ==========================================================================
   PAINEIS: EMPRESA E ADMIN
   Os componentes abaixo vieram da camada anterior e falam --tdt-*; este bloco
   liga esses nomes aos tokens desta folha, para o tema claro/escuro continuar
   valendo com uma unica fonte de verdade.
   ========================================================================== */
:root,
html[data-theme="light"],
html[data-theme="dark"] {
  --tdt-accent: var(--accent);
  --tdt-accent-2: var(--accent-2);
  --tdt-accent-ink: var(--accent-ink);
  --tdt-bg: var(--bg);
  --tdt-surface: var(--surface);
  --tdt-surface-2: var(--surface-2);
  --tdt-border: var(--border);
  --tdt-text: var(--text);
  --tdt-text-muted: var(--text-muted);
  --tdt-text-faint: var(--text-faint);
  --tdt-hero-bg: var(--hero-bg);
  --tdt-hero-muted: var(--hero-muted);
  --tdt-hero-line: var(--hero-line);
  --tdt-shadow-1: var(--shadow-1);
  --tdt-shadow-2: var(--shadow-2);
  --tdt-shadow-hero: var(--shadow-hero);
  --tdt-r-sm: var(--r-sm);
  --tdt-r-md: var(--r-md);
  --tdt-r-lg: var(--r-lg);
  --tdt-shell: var(--shell);
  --tdt-side: var(--side-w);
  --tdt-good: #059669;
  --tdt-bad: #e11d48;
}
html[data-theme="dark"] { --tdt-good: #4ade80; --tdt-bad: #fb7185; }

/* ---------- 4. APP BAR ---------- */
.tdt-appbar {
  background: color-mix(in srgb, var(--tdt-bg) 88%, transparent);
  border-bottom-color: transparent;
}
.tdt-appbar.is-stuck {
  border-bottom-color: var(--tdt-border);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.05);
}
/* A app bar acompanha a largura da coluna de conteudo de cada tela,
   senao o cabecalho fica mais largo que o conteudo e o alinhamento quebra. */
@media (min-width: 1024px) {
  .tdt-appbar__inner,
  body.tdt-has-sidebar .tdt-appbar__inner { max-width: 820px; }
  body[data-page="meus_pontos"] .tdt-appbar__inner,
  body.tdt-has-sidebar[data-page="meus_pontos"] .tdt-appbar__inner { max-width: var(--tdt-shell); }
}
.tdt-appbar__hello { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; color: var(--tdt-text); }
.tdt-appbar__sub { font-size: 13px; color: var(--tdt-text-muted); }
.tdt-icon-btn {
  background: var(--tdt-surface); color: var(--tdt-text);
  border: 1px solid var(--tdt-border); border-radius: var(--tdt-r-sm);
}
.tdt-avatar-btn { border-color: var(--tdt-accent); background: var(--tdt-surface); color: var(--tdt-accent); }


/* ==========================================================================
   PARTE 2 — COMPONENTES DE PAINEL (empresa e admin)
   Portados do prototipo. Usados pelo markup estatico das telas convertidas.
   ========================================================================== */

/* Heroi generico (a versao do cliente e .wallet-card) */
.tdt-hero {
  position: relative; overflow: hidden;
  background: var(--tdt-hero-bg); color: #fff;
  border-radius: var(--tdt-r-lg); padding: 24px;
  box-shadow: var(--tdt-shadow-hero);
}
.tdt-hero::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(233, 30, 133, 0.42), transparent 68%);
  pointer-events: none;
}
.tdt-hero > * { position: relative; z-index: 1; }
.tdt-hero__label {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--tdt-hero-muted);
}
.tdt-hero__title { margin: 10px 0 0; font-size: clamp(24px, 3.4vw, 30px); font-weight: 800; letter-spacing: -0.6px; line-height: 1.15; }
.tdt-hero__text { margin: 9px 0 0; font-size: 14px; line-height: 1.6; color: var(--tdt-hero-muted); max-width: 60ch; }
.tdt-hero__meta { margin: 8px 0 0; font-size: 12.5px; color: var(--tdt-hero-muted); }
.tdt-hero__row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.tdt-hero__logo {
  width: 76px; height: 76px; border-radius: var(--tdt-r-md); flex: 0 0 auto;
  background: #fff; object-fit: contain; padding: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}
.tdt-hero__actions { display: grid; gap: 10px; margin-top: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .tdt-hero__actions { margin-top: 0; width: 320px; align-content: start; } }

/* Botoes */
.tdt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 18px; border-radius: var(--tdt-r-sm); border: 0; cursor: pointer;
  background: var(--tdt-accent); color: #fff; font: inherit; font-size: 14.5px; font-weight: 700;
  text-decoration: none; box-shadow: 0 10px 22px rgba(176, 23, 116, 0.28);
}
.tdt-btn .material-symbols-outlined { font-size: 20px; }
.tdt-btn--ghost { background: var(--tdt-surface-2); color: var(--tdt-text); box-shadow: none; border: 1px solid var(--tdt-border); }
.tdt-btn--light { background: #fff; color: #17131f; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14); }
.tdt-btn--onhero { background: rgba(255, 255, 255, 0.14); color: #fff; box-shadow: none; border: 1px solid var(--tdt-hero-line); }
.tdt-btn--sm { height: 40px; font-size: 13.5px; padding: 0 14px; }
.tdt-btn--block { width: 100%; }

/* KPIs */
.tdt-kgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 800px) { .tdt-kgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tdt-k {
  background: var(--tdt-surface); border: 1px solid var(--tdt-border);
  border-radius: var(--tdt-r-md); padding: 16px; box-shadow: var(--tdt-shadow-1);
}
.tdt-k__l {
  display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--tdt-text-faint);
}
.tdt-k__l .material-symbols-outlined { font-size: 16px; }
.tdt-k__v { font-size: 27px; font-weight: 800; letter-spacing: -1px; margin-top: 9px; color: var(--tdt-text); }
.tdt-k__d { font-size: 12.5px; margin-top: 5px; color: var(--tdt-text-muted); }
.tdt-k__d.is-up { color: var(--tdt-good); font-weight: 700; }
.tdt-k__d.is-down { color: var(--tdt-bad); font-weight: 700; }

/* Atalhos da empresa */
.empresa-shortcut-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  padding: 16px 8px; text-align: center; text-decoration: none;
  background: var(--tdt-surface); border: 1px solid var(--tdt-border);
  border-radius: var(--tdt-r-md); box-shadow: var(--tdt-shadow-1);
  color: var(--tdt-text); font-size: 12.5px; font-weight: 600; min-height: 96px;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.empresa-shortcut-card:hover { transform: translateY(-2px); box-shadow: var(--tdt-shadow-2); }
.empresa-shortcut-card .material-symbols-outlined {
  width: 44px; height: 44px; border-radius: var(--tdt-r-sm); display: grid; place-items: center;
  background: color-mix(in srgb, var(--tdt-accent) 12%, transparent); color: var(--tdt-accent); font-size: 22px;
}
html[data-theme="dark"] .empresa-shortcut-card .material-symbols-outlined { color: #f472b6; }
.tdt-grid-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .tdt-grid-shortcuts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Linhas de movimento / listas de painel */
.tdt-tx { display: flex; flex-direction: column; }
.tdt-tx__r { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--tdt-border); }
.tdt-tx__r:last-child { border-bottom: 0; padding-bottom: 0; }
.tdt-tx__ic {
  width: 38px; height: 38px; border-radius: 999px; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--tdt-surface-2); color: var(--tdt-text-muted);
}
.tdt-tx__ic .material-symbols-outlined { font-size: 19px; }
.tdt-tx__b { min-width: 0; flex: 1; }
.tdt-tx__t { font-size: 14px; font-weight: 600; color: var(--tdt-text); }
.tdt-tx__d { font-size: 11.5px; color: var(--tdt-text-faint); margin-top: 2px; }
.tdt-tx__v { font-size: 15px; font-weight: 800; color: var(--tdt-text); }
.tdt-tx__v.is-in { color: var(--tdt-good); }
.tdt-tx__v.is-out { color: var(--tdt-bad); }

/* Pilulas de estado */
.tdt-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.tdt-pill .material-symbols-outlined { font-size: 14px; }
.tdt-pill--ok { background: color-mix(in srgb, #059669 14%, transparent); color: #047857; }
.tdt-pill--warn { background: color-mix(in srgb, #d97706 16%, transparent); color: #b45309; }
.tdt-pill--bad { background: color-mix(in srgb, #e11d48 14%, transparent); color: #be123c; }
.tdt-pill--info { background: color-mix(in srgb, #2563eb 14%, transparent); color: #1d4ed8; }
html[data-theme="dark"] .tdt-pill--ok { color: #4ade80; }
html[data-theme="dark"] .tdt-pill--warn { color: #fbbf24; }
html[data-theme="dark"] .tdt-pill--bad { color: #fb7185; }
html[data-theme="dark"] .tdt-pill--info { color: #60a5fa; }

/* Colunas de painel */
/* .tdt-panel e usado no balcao, no QR da loja e nos blocos que o bundle injeta,
   mas nunca teve base: os cartoes apareciam sem fundo, sem borda e sem forma. */
.tdt-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 18px; box-shadow: var(--shadow-1);
}
.tdt-panel + .tdt-panel { margin-top: 16px; }
.tdt-panel__t {
  font-size: var(--step-cap); font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-faint); margin: 0 0 14px;
}
.tdt-panelgrid { display: grid; gap: 16px; }
@media (min-width: 900px) { .tdt-panelgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Coluna do painel: mesma medida do app do cliente */
.tdt-panelmain {
  width: 100%; max-width: 480px; margin: 0 auto;
  padding: 0 16px calc(110px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 26px;
}
@media (min-width: 1024px) { .tdt-panelmain { max-width: 1100px; padding-left: 24px; padding-right: 24px; } }

/* Blocos que o bundle ainda injeta com utilitario Tailwind: alinha superficie
   e raio para nao destoar enquanto o JS nao e convertido. Precisa de
   !important porque o CDN injeta o <style> depois desta folha. */
body[data-page="dashboard_parceiro"] .bg-surface-container-lowest,
body[data-page="dashboard_parceiro"] .bg-surface-container-low,
body[data-page="dashboard_parceiro"] .bg-surface-container,
body[data-page="gest_o_de_ofertas_parceiro"] .bg-surface-container-lowest,
body[data-page="gest_o_de_ofertas_parceiro"] .bg-surface-container-low,
body[data-page="gest_o_de_ofertas_parceiro"] .bg-surface-container,
body[data-page="gestao_pontos"] .bg-surface-container-lowest,
body[data-page="gestao_pontos"] .bg-surface-container-low {
  background-color: var(--tdt-surface) !important;
  border: 1px solid var(--tdt-border) !important;
  border-radius: var(--tdt-r-md) !important;
  box-shadow: var(--tdt-shadow-1) !important;
}
body[data-page="dashboard_parceiro"] .text-on-surface,
body[data-page="gest_o_de_ofertas_parceiro"] .text-on-surface,
body[data-page="gestao_pontos"] .text-on-surface { color: var(--tdt-text) !important; }
body[data-page="dashboard_parceiro"] .text-on-surface-variant,
body[data-page="dashboard_parceiro"] .text-outline,
body[data-page="gest_o_de_ofertas_parceiro"] .text-on-surface-variant,
body[data-page="gest_o_de_ofertas_parceiro"] .text-outline,
body[data-page="gestao_pontos"] .text-on-surface-variant { color: var(--tdt-text-muted) !important; }

/* Tiles de ferramenta da gestao de ofertas */
.offer-tool-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  min-height: 96px; padding: 16px 8px; text-align: center; text-decoration: none;
  background: var(--tdt-surface); border: 1px solid var(--tdt-border);
  border-radius: var(--tdt-r-md); box-shadow: var(--tdt-shadow-1);
  color: var(--tdt-text); font-size: 12.5px; font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.offer-tool-card:hover { transform: translateY(-2px); box-shadow: var(--tdt-shadow-2); }
.offer-tool-card .material-symbols-outlined {
  width: 44px; height: 44px; border-radius: var(--tdt-r-sm); display: grid; place-items: center;
  background: color-mix(in srgb, var(--tdt-accent) 12%, transparent); color: var(--tdt-accent); font-size: 22px;
}
html[data-theme="dark"] .offer-tool-card .material-symbols-outlined { color: #f472b6; }
.offer-tool-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .offer-tool-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .offer-tool-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* Formularios dos paineis */
.tdt-field { display: grid; gap: 7px; margin-bottom: 14px; }
.tdt-field__l { font-size: 12.5px; font-weight: 700; color: var(--tdt-text-muted); }
.tdt-input, .tdt-select, .tdt-textarea {
  width: 100%; padding: 0 15px; border-radius: var(--tdt-r-sm);
  font: inherit; font-size: 15px; color: var(--tdt-text);
  background: var(--tdt-surface); border: 1px solid var(--tdt-border); outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tdt-input, .tdt-select { height: 50px; }
.tdt-textarea { padding: 13px 15px; min-height: 92px; resize: vertical; line-height: 1.5; }
.tdt-input:focus, .tdt-select:focus, .tdt-textarea:focus {
  border-color: var(--tdt-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tdt-accent) 16%, transparent);
}
.tdt-input::placeholder, .tdt-textarea::placeholder { color: var(--tdt-text-faint); }
.tdt-fieldrow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tdt-check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--tdt-text); margin-bottom: 14px; }
.tdt-check input { width: 20px; height: 20px; accent-color: var(--tdt-accent); }

/* Barra de filtros em chips com rolagem */
.tdt-chipbar { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tdt-chipbar::-webkit-scrollbar { display: none; }

/* Ponte com o bundle: ele liga/desliga a classe utilitaria `bg-primary` para
   marcar o filtro ativo. Enquanto o JS nao e convertido, o chip entende isso. */
.tdt-chip.bg-primary,
.tdt-chip.bg-primary:hover {
  background: var(--tdt-accent) !important;
  border-color: var(--tdt-accent) !important;
  color: #fff !important;
}

/* Scanner de QR (balcao da empresa e vinculo do cliente) */
.tdt-scan {
  position: relative; width: 100%; max-width: 460px; margin: 0 auto;
  aspect-ratio: 3 / 4; border-radius: var(--tdt-r-lg); overflow: hidden; background: #0b0b10;
}
@media (min-width: 700px) { .tdt-scan { aspect-ratio: 4 / 3; } }
.tdt-scan__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tdt-scan__frame {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: min(64%, 260px); aspect-ratio: 1; border-radius: 22px; z-index: 2;
  box-shadow: 0 0 0 9999px rgba(6, 6, 10, 0.62);
  display: grid; place-items: center;
}
.tdt-scan__c { position: absolute; width: 34px; height: 34px; border: 4px solid var(--tdt-accent-2); }
.tdt-scan__c--tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 18px 0 0 0; }
.tdt-scan__c--tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-radius: 0 18px 0 0; }
.tdt-scan__c--bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 18px; }
.tdt-scan__c--br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 18px 0; }
.tdt-scan__ph { color: rgba(255, 255, 255, 0.5); font-size: 76px; }
.tdt-scan__ok {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center;
  background: rgba(5, 150, 105, 0.35); backdrop-filter: blur(2px);
  border-radius: 22px; color: #fff;
}
.tdt-scan__ok .material-symbols-outlined { font-size: 76px; font-variation-settings: 'FILL' 1; }
.tdt-scan__status {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 4;
  padding: 8px 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.tdt-scan__tools { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; gap: 10px; }
.tdt-scan__tool {
  height: 42px; padding: 0 14px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(8px); color: #fff;
  display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 12.5px; font-weight: 700;
}
.tdt-scan__tool .material-symbols-outlined { font-size: 18px; }
.tdt-scan__close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 40px; height: 40px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(8px); color: #fff;
  display: grid; place-items: center;
}
.tdt-scan__hint { margin: 16px auto 0; max-width: 460px; text-align: center; font-size: 13.5px; line-height: 1.55; color: var(--tdt-text-muted); }

/* ---------- CONTROLES NATIVOS NAS TELAS DE PAINEL ----------
   As telas de gestao (empresa e admin) tem dezenas de campos escritos com
   utilitario Tailwind. Em vez de reescrever cada um, o proprio elemento recebe
   o visual do sistema. Especificidade (0,1,1) vence a do utilitario (0,1,0),
   entao funciona mesmo com o CDN injetando estilo depois. */
body[data-page="gestao_pontos"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body[data-page="gestao_pontos"] select,
body[data-page="gestao_pontos"] textarea,
body[data-page="gest_o_de_ofertas_parceiro"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body[data-page="gest_o_de_ofertas_parceiro"] select,
body[data-page="gest_o_de_ofertas_parceiro"] textarea,
body[data-page="gest_o_de_estabelecimentos"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body[data-page="gest_o_de_estabelecimentos"] select,
body[data-page="gest_o_de_usu_rios_master"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body[data-page="gest_o_de_usu_rios_master"] select,
body[data-page="gest_o_de_clientes_master"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body[data-page="gest_o_de_clientes_master"] select,
body[data-page="configuracoes_admin"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body[data-page="configuracoes_admin"] select,
body[data-page="configuracoes_admin"] textarea {
  min-height: 48px; padding: 12px 15px; border-radius: var(--tdt-r-sm);
  background: var(--tdt-surface); border: 1px solid var(--tdt-border);
  color: var(--tdt-text); font: inherit; font-size: 15px; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
body[data-page="gestao_pontos"] textarea,
body[data-page="gest_o_de_ofertas_parceiro"] textarea,
body[data-page="configuracoes_admin"] textarea { min-height: 92px; line-height: 1.5; }
body[data-page="gestao_pontos"] input:focus,
body[data-page="gestao_pontos"] select:focus,
body[data-page="gestao_pontos"] textarea:focus,
body[data-page="gest_o_de_ofertas_parceiro"] input:focus,
body[data-page="gest_o_de_ofertas_parceiro"] select:focus,
body[data-page="gest_o_de_ofertas_parceiro"] textarea:focus,
body[data-page="gest_o_de_estabelecimentos"] input:focus,
body[data-page="gest_o_de_usu_rios_master"] input:focus,
body[data-page="gest_o_de_clientes_master"] input:focus,
body[data-page="configuracoes_admin"] input:focus {
  border-color: var(--tdt-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tdt-accent) 16%, transparent);
}
body[data-page="gestao_pontos"] input[type="checkbox"],
body[data-page="gest_o_de_ofertas_parceiro"] input[type="checkbox"],
body[data-page="configuracoes_admin"] input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--tdt-accent); }

/* Tabelas de gestao */
body[data-page="gestao_pontos"] table,
body[data-page^="gest_o_"] table,
body[data-page="relat_rios_gerais_master"] table,
body[data-page="tickets_admin_master"] table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
body[data-page="gestao_pontos"] th,
body[data-page^="gest_o_"] th,
body[data-page="relat_rios_gerais_master"] th,
body[data-page="tickets_admin_master"] th {
  text-align: left; padding: 11px 12px; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--tdt-text-faint);
  border-bottom: 1px solid var(--tdt-border); white-space: nowrap;
}
body[data-page="gestao_pontos"] td,
body[data-page^="gest_o_"] td,
body[data-page="relat_rios_gerais_master"] td,
body[data-page="tickets_admin_master"] td {
  padding: 13px 12px; border-bottom: 1px solid var(--tdt-border); color: var(--tdt-text);
}
body[data-page="gestao_pontos"] tbody tr:hover,
body[data-page^="gest_o_"] tbody tr:hover { background: var(--tdt-surface-2); }

/* ---------- 17. BOTAO DE TEMA ---------- */
.tdt-theme-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  background: var(--tdt-surface); color: var(--tdt-text);
  border: 1px solid var(--tdt-border); font: inherit; font-size: 13px; font-weight: 700;
}
.tdt-theme-btn .material-symbols-outlined { font-size: 18px; }
.tdt-theme-btn:active { transform: scale(0.96); }

/* ==========================================================================
   MINI-UTILITARIOS
   O bundle ainda injeta blocos escritos com utilitario Tailwind. Como as
   paginas convertidas nao carregam mais o CDN, as classes que ele realmente
   usa sao definidas aqui — presas aos tokens desta folha, entao seguem o tema.
   Levantadas dos templates do proprio bundle, nao adivinhadas.
   Este bloco sai quando o markup do bundle for convertido.
   ========================================================================== */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
/* Item de grid tem min-width:auto = min-content: um titulo com white-space
   nowrap la dentro empurra a coluna inteira e a pagina passa a arrastar de
   lado. Com min-width:0 a coluna encolhe e quem trunca trunca de verdade. */
.grid > * { min-width: 0; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.uppercase { text-transform: uppercase; }
/* ATENCAO ao min-width: com white-space:nowrap o minimo automatico do elemento
   passa a ser o texto INTEIRO. Como item de flex/grid ele empurrava o pai para
   fora da tela em vez de cortar — era o que fazia o perfil arrastar de lado.
   Quem trunca nunca deve alargar o pai. */
.truncate {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}

.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; } .p-3 { padding: 12px; } .p-4 { padding: 16px; } .p-5 { padding: 20px; }
.px-3 { padding-left: 12px; padding-right: 12px; } .px-4 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; } .py-3 { padding-top: 12px; padding-bottom: 12px; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }

.text-\[10px\] { font-size: 10px; }
.text-\[11px\] { font-size: 11px; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 13.5px; }
.text-base { font-size: 15px; }
.text-lg { font-size: 17px; }
.text-xl { font-size: 19px; }
.text-2xl { font-size: 23px; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-headline, .font-body, .font-label { font-family: var(--font); }
.tracking-\[0\.14em\] { letter-spacing: 0.14em; }
.tracking-\[0\.16em\] { letter-spacing: 0.16em; }
.tracking-wider { letter-spacing: 0.05em; }
.leading-6 { line-height: 1.6; }

.rounded-lg { border-radius: var(--r-xs); }
.rounded-xl { border-radius: var(--r-sm); }
.rounded-2xl { border-radius: var(--r-md); }
.rounded-full { border-radius: var(--r-pill); }
.border { border: 1px solid var(--border); }
.shadow-sm { box-shadow: var(--shadow-1); }

.bg-white,
.bg-surface-container-lowest { background-color: var(--surface); }
.bg-surface-container-low,
.bg-surface-container,
.bg-surface-container-high { background-color: var(--surface-2); }
.text-on-surface { color: var(--text); }
.text-on-surface-variant, .text-outline, .text-outline-variant { color: var(--text-muted); }
.text-primary, .text-tertiary { color: var(--accent); }
[data-theme="dark"] .text-primary, [data-theme="dark"] .text-tertiary { color: #f472b6; }
.text-white { color: #fff; }
.bg-primary { background-color: var(--accent); color: #fff; }
.opacity-60 { opacity: 0.6; }
.opacity-70 { opacity: 0.7; }
.cursor-not-allowed { cursor: not-allowed; }

/* Cartoes injetados: superficie + borda, para nao ficarem "soltos" */
.bg-surface-container-lowest.rounded-2xl,
.bg-surface-container-lowest.rounded-xl,
.bg-surface-container-low.rounded-2xl,
.bg-surface-container-low.rounded-xl {
  border: 1px solid var(--border); box-shadow: var(--shadow-1);
}

/* App bar e cabecalho de secao completos (antes dependiam do CSS antigo) */
.tdt-appbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.tdt-appbar.is-stuck { border-bottom-color: var(--border); }
.tdt-appbar__inner {
  width: min(var(--shell), 100%); margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 16px;
}
@media (min-width: 1100px) { .tdt-appbar__inner { padding: 20px 28px; } }
.tdt-appbar__greet { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tdt-appbar__hello { font-size: var(--step-h1); font-weight: 800; letter-spacing: -0.4px; line-height: 1.15; color: var(--text); }
.tdt-appbar__sub { font-size: var(--step-cap); color: var(--text-muted); margin-top: 2px; }
.tdt-appbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.tdt-icon-btn {
  width: 42px; height: 42px; border-radius: var(--r-sm); flex: 0 0 auto;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  display: grid; place-items: center; cursor: pointer; text-decoration: none;
}
.tdt-section__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.tdt-section__title { font-size: var(--step-h2); font-weight: 800; letter-spacing: -0.3px; margin: 0; color: var(--text); }
.tdt-section__link { margin-left: auto; font-size: var(--step-cap); font-weight: 700; color: var(--accent); text-decoration: none; }
[data-theme="dark"] .tdt-section__link { color: #f472b6; }
.tdt-section__count { margin-left: auto; font-size: var(--step-cap); color: var(--text-faint); }

/* KPIs do painel: 2 colunas no celular, 4 no desktop (o inline das paginas
   nao deve travar em 2 numa tela larga) */
@media (min-width: 900px) {
  .tdt-kgrid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .tdt-kgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

/* Grades responsivas usadas pelos blocos injetados */
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:hidden { display: none !important; }
  .lg\:flex { display: flex; }
}
.col-span-2 { grid-column: span 2 / span 2; }

/* A app bar acompanha a largura da coluna de conteudo do painel */
body[data-profile="painel"] .tdt-appbar__inner,
.tdt-panelmain ~ * .tdt-appbar__inner { max-width: 1100px; }

/* Cartoes de fidelidade e resgate desenhados pelo bundle (tela Beneficios) */
.loyalty-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: 18px;
}
.loyalty-card--ready { border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: var(--shadow-2); }
.loyalty-logo {
  width: 56px; height: 56px; border-radius: var(--r-sm); object-fit: cover;
  background: var(--surface-2); flex: 0 0 auto;
}
.loyalty-progress-track { height: 8px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.loyalty-progress-bar { height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .5s ease; }
.loyalty-reward-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; width: 100%;
  border-radius: var(--r-sm); background: var(--surface-2); color: var(--text);
  font-size: 13.5px; font-weight: 600;
}
.loyalty-redeem-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  height: 48px; border-radius: var(--r-sm); border: 0; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-size: 14.5px; font-weight: 700;
  box-shadow: 0 10px 22px rgba(176, 23, 116, 0.28); text-decoration: none;
}
.loyalty-redeem-btn[disabled] { background: var(--surface-2); color: var(--text-faint); box-shadow: none; cursor: not-allowed; }
.loyalty-status-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 700;
  background: color-mix(in srgb, #059669 14%, transparent); color: #047857;
}
[data-theme="dark"] .loyalty-status-badge { color: #4ade80; }
.tdt-skeleton { background: var(--surface-2); border-radius: 10px; }
.h-3 { height: 12px; } .h-4 { height: 16px; } .h-14 { height: 56px; } .h-16 { height: 64px; }
.w-14 { width: 56px; } .w-1\/3 { width: 33%; } .w-2\/3 { width: 66%; }
.h-12 { height: 48px; } .w-12 { width: 48px; } .h-2 { height: 8px; } .w-2 { width: 8px; }

/* Extrato: entrada e saida coloridas por tipo (o bundle marca a linha) */
.tdt-val--in { color: #059669; }
.tdt-val--out { color: #e11d48; }
[data-theme="dark"] .tdt-val--in { color: #4ade80; }
[data-theme="dark"] .tdt-val--out { color: #fb7185; }

/* ==========================================================================
   PERFIL DO CLIENTE
   A tela tem 35 ids e varios formularios; em vez de reescrever o markup, os
   componentes proprios dela (profile-*) recebem o visual aprovado.
   ========================================================================== */
.profile-appbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent;
}
.profile-appbar__inner {
  width: min(var(--shell), 100%); margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
@media (min-width: 1100px) { .profile-appbar__inner { padding: 18px 28px; } }
.profile-appbar__title { flex: 1; margin: 0; font-size: var(--step-h1); font-weight: 800; letter-spacing: -0.4px; color: var(--text); }
.profile-appbar__btn {
  width: 42px; height: 42px; border-radius: var(--r-sm); flex: 0 0 auto;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  display: grid; place-items: center; text-decoration: none; cursor: pointer;
}
.profile-appbar__btn--ghost { border-color: transparent; background: transparent; }

/* Heroi do perfil: mesma superficie escura do saldo */
.profile-hero-shell, #profileHeroShell {
  position: relative; overflow: hidden; color: #fff;
  background: var(--hero-bg) !important; border-radius: var(--r-lg);
  box-shadow: var(--shadow-hero); padding: 22px;
}
.profile-hero-shell::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(233,30,133,0.42), transparent 68%); pointer-events: none;
}
.profile-hero-shade { display: none; }
.profile-hero { position: relative; z-index: 1; }

/* Cartoes de secao */
.profile-surface-card, .push-consent-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: 18px;
}

/* Atalhos em tile */
.profile-quick {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
}
.profile-quick > a, .profile-quick > button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 6px 12px; text-align: center; text-decoration: none; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-1); color: var(--text); font-size: 12.5px; font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.profile-quick > a:hover, .profile-quick > button:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.profile-quick .material-symbols-outlined {
  width: 44px; height: 44px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-size: 22px;
}
[data-theme="dark"] .profile-quick .material-symbols-outlined { color: #f472b6; }

/* Linhas de acao */
.profile-action-row {
  display: flex; align-items: center; gap: 13px; padding: 14px 0;
  border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text);
}
.profile-action-row:last-child { border-bottom: 0; }
.profile-action-icon {
  width: 40px; height: 40px; border-radius: var(--r-sm); flex: 0 0 auto;
  background: var(--surface-2); color: var(--text-muted); display: grid; place-items: center;
}

/* Botoes */
.profile-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 18px; border-radius: var(--r-sm); border: 0; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-size: 14.5px; font-weight: 700;
  text-decoration: none; box-shadow: 0 10px 22px rgba(176, 23, 116, 0.28);
}
.profile-btn--navy, .profile-btn--teal { background: var(--surface-2); color: var(--text); box-shadow: none; border: 1px solid var(--border); }
.profile-btn--ghost { background: transparent; color: var(--text-muted); box-shadow: none; border: 1px solid var(--border); }

/* Campos dentro do perfil */
body[data-page="meu_perfil"] input:not([type="checkbox"]):not([type="radio"]),
body[data-page="meu_perfil"] select,
body[data-page="meu_perfil"] textarea {
  width: 100%; min-height: 48px; padding: 12px 15px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font: inherit; font-size: 15px; outline: none;
}
body[data-page="meu_perfil"] input:focus,
body[data-page="meu_perfil"] select:focus,
body[data-page="meu_perfil"] textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
body[data-page="meu_perfil"] label { font-size: 12.5px; font-weight: 700; color: var(--text-muted); }

/* Coluna de conteudo padrao (telas que mantiveram markup proprio).
   NAO vale para quem ja e .ap-shell: essas telas tem grade de duas colunas e
   o max-width de 480px espremia o conteudo contra o trilho. */
.tdt-home:not(.ap-shell) { width: 100%; max-width: 480px; margin: 0 auto; padding: 0 16px calc(110px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 1024px) {
  .tdt-home:not(.ap-shell) { max-width: 820px; padding-left: 24px; padding-right: 24px; }
}

/* Utilitarios de posicao e medida usados pelo heroi do perfil */
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { inset: 0; }
.z-10 { z-index: 10; }
.overflow-hidden { overflow: hidden; }
.object-cover { object-fit: cover; }
.shrink-0 { flex: 0 0 auto; }
.min-w-0 { min-width: 0; }
.items-end { align-items: flex-end; }
.text-right { text-align: right; }
.h-2 { height: 8px; } .h-16 { height: 64px; } .w-16 { width: 64px; }
.h-full { height: 100%; } .w-full { width: 100%; }
.max-w-\[150px\] { max-width: 150px; }
.p-3\.5 { padding: 14px; } .gap-3\.5 { gap: 14px; }
.mt-0\.5 { margin-top: 2px; } .mt-2\.5 { margin-top: 10px; }
.px-2\.5 { padding-left: 10px; padding-right: 10px; }
.py-0\.5 { padding-top: 2px; padding-bottom: 2px; }
.leading-4 { line-height: 1.35; }
.bg-white\/10 { background-color: rgba(255,255,255,0.10); }
.bg-white\/12 { background-color: rgba(255,255,255,0.12); }
.bg-white\/14 { background-color: rgba(255,255,255,0.14); }
.bg-white\/15 { background-color: rgba(255,255,255,0.15); }
.bg-white\/85 { background-color: rgba(255,255,255,0.85); }
.text-white\/62 { color: rgba(255,255,255,0.62); }
.text-white\/70 { color: rgba(255,255,255,0.70); }
.text-white\/76 { color: rgba(255,255,255,0.76); }
.ring-1 { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14); }
.ring-white\/10, .ring-white\/14 { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14); }
.profile-hero__cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  margin-top: 16px; width: 100%; height: 48px; border-radius: var(--r-sm);
  background: rgba(255,255,255,0.14); color: #fff; text-decoration: none;
  font-size: 14.5px; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
}
/* O logo dentro do heroi nao pode crescer sem limite */
.profile-hero-shell img { max-width: 100%; }

/* Folha de atalhos: os links vinham do CSS antigo e ficaram sem forma
   (e ilegiveis no tema escuro) nas telas convertidas. */
.app-mobile-sheet__grabber {
  width: 42px; height: 4px; border-radius: 999px; margin: 0 auto 16px;
  background: var(--border);
}
.app-mobile-sheet__grid { display: grid; gap: 10px; }
@media (min-width: 560px) { .app-mobile-sheet__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.app-mobile-sheet__link {
  display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 16px;
  border-radius: var(--r-sm); text-decoration: none;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-size: 14px; font-weight: 700;
}
.app-mobile-sheet__link .material-symbols-outlined { color: var(--accent); font-size: 22px; }
[data-theme="dark"] .app-mobile-sheet__link .material-symbols-outlined { color: #f472b6; }
.app-mobile-sheet__link:active { transform: scale(0.98); }

/* ==========================================================================
   VITRINE E DETALHE DO PARCEIRO
   ========================================================================== */
.tdt-store-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 640px) { .tdt-store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .tdt-store-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tdt-store-skel { height: 190px; border-radius: var(--r-md); background: var(--surface-2); }
.tdt-store-card {
  display: block; text-decoration: none; overflow: hidden; position: relative;
  border-radius: var(--r-md); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-1); color: var(--text);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.tdt-store-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.tdt-store-card__img { position: relative; height: 150px; background: var(--surface-2); }
.tdt-store-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tdt-store-card__badge {
  position: absolute; top: 10px; left: 10px; padding: 5px 10px; border-radius: var(--r-pill);
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); color: #fff; font-size: 11px; font-weight: 700;
}
.tdt-store-card__body { padding: 14px; }
.tdt-store-card__name { font-size: 15.5px; font-weight: 700; letter-spacing: -0.2px; color: var(--text); }
.tdt-store-card__meta { margin-top: 4px; font-size: var(--step-cap); color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.tdt-store-card__star { display: inline-flex; align-items: center; gap: 3px; color: #f0a500; font-weight: 800; }
.tdt-store-card__star .material-symbols-outlined { font-size: 15px; }

/* Detalhe */
.tdt-detail { display: grid; gap: 18px; }
.tdt-cover {
  position: relative; height: 190px; border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface-2); box-shadow: var(--shadow-1);
}
.tdt-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* O fallback da capa e uma div, nao um img: precisa da mesma area. */
.tdt-cover__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tdt-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,0.7)); }
.tdt-cover__top {
  position: absolute; inset: 12px 12px auto 12px; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.tdt-cover__back {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(12, 12, 18, 0.55); color: #fff; text-decoration: none;
  backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, 0.18);
}
/* O logo sobe sobre a capa; o texto nao. Com -46px o nome subia junto e ficava
   por cima da foto, ilegivel. -26px deixa o logo sobreposto e o bloco de texto
   inteiro abaixo da borda da capa. */
.tdt-detail-head { display: flex; align-items: flex-end; gap: 14px; margin-top: -26px; position: relative; z-index: 2; padding: 0 4px; }
.tdt-detail-logo {
  width: 76px; height: 76px; border-radius: var(--r-md); flex: 0 0 auto; object-fit: cover;
  background: var(--surface); border: 3px solid var(--surface); box-shadow: var(--shadow-1);
}
.tdt-detail-name {
  font-size: 21px; font-weight: 800; letter-spacing: -0.4px; color: var(--text);
  margin: 2px 0 0; line-height: 1.25;
}
.tdt-detail-cat {
  font-size: var(--step-cap); color: var(--text-muted); margin: 0;
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;
}
.tdt-detail-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tdt-detail-reviews { font-size: var(--step-cap); color: var(--text-muted); }
.tdt-detail-addr { font-size: var(--step-cap); color: var(--text-muted); line-height: 1.55; margin: 0; }
.tdt-detail-hint { font-size: 12.5px; color: var(--text-faint); text-align: center; line-height: 1.5; }
/* ATENCAO: .tdt-detail-cta e o CONTAINER dos botoes, nao um botao. Estilizado
   como botao, os dois filhos ficavam colados dentro de uma unica pilula rosa. */
.tdt-detail-cta { display: grid; gap: 10px; }
.tdt-detail-cta:has(> .btn:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tdt-detail-icons, .tdt-social { display: flex; gap: 10px; flex-wrap: wrap; }
/* Icone + rotulo lado a lado: em caixa fixa de 44px o texto vazava por tras. */
.tdt-icon-action {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
  border-radius: var(--r-pill); background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.tdt-icon-action .material-symbols-outlined { font-size: 19px; color: var(--text-muted); }
.tdt-social a {
  width: 44px; height: 44px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border); text-decoration: none;
}
.tdt-rating-pill, .tdt-chip-status {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text-muted); font-size: 12.5px; font-weight: 700;
}
.tdt-linked-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
  font-size: 13.5px; font-weight: 700;
}
[data-theme="dark"] .tdt-linked-badge { color: #f472b6; }
.tdt-progress { height: 8px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.tdt-progress > * { height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.tdt-loyalty-meta { font-size: var(--step-cap); color: var(--text-muted); }
.tdt-reviews-top { display: flex; align-items: center; gap: 14px; }
.tdt-reviews-score { font-size: 34px; font-weight: 800; letter-spacing: -1px; color: var(--text); }
/* Botao de nota (1 a 5) do formulario de avaliacao. Precisa de estado visivel:
   sem ele a pessoa nao sabe que nota escolheu. */
.tdt-review-star {
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); font: inherit; font-size: 15px; font-weight: 800;
  cursor: pointer; transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.tdt-review-star:hover { transform: translateY(-1px); }
.tdt-review-star.is-active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.tdt-contact { display: grid; gap: 2px; }
.tdt-contact__row { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.tdt-contact__row:last-child { border-bottom: 0; }
.tdt-contact__icon { width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-muted); display: grid; place-items: center; flex: 0 0 auto; }
.tdt-contact__k { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); font-weight: 700; }
.tdt-contact__v { font-size: 14px; font-weight: 600; color: var(--text); margin-top: 2px; }
.tdt-benefit {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-1); overflow: hidden;
}
.tdt-benefit--pad { padding: 16px; }
.tdt-benefit__head { display: flex; align-items: center; gap: 12px; }
.tdt-benefit__icon { width: 44px; height: 44px; border-radius: var(--r-sm); flex: 0 0 auto; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
[data-theme="dark"] .tdt-benefit__icon { color: #f472b6; }
.tdt-benefit__img { width: 100%; height: 132px; object-fit: cover; display: block; }
.tdt-benefit__title { font-size: 15.5px; font-weight: 700; color: var(--text); }
.tdt-benefit__desc { font-size: var(--step-cap); color: var(--text-muted); line-height: 1.55; margin-top: 4px; }
.tdt-benefit__hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }
.tdt-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: 18px; }
.tdt-block__title { font-size: 15.5px; font-weight: 800; color: var(--text); margin: 0 0 10px; }
.tdt-block__text { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin: 0; }

/* Busca e chips com o nome tdt-* (usados pelas telas que mantiveram markup) */
.tdt-searchbar {
  display: flex; align-items: center; gap: 11px; height: 52px; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill);
  box-shadow: var(--shadow-1); color: var(--text-faint);
}
.tdt-searchbar input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 14.5px; color: var(--text);
}
.tdt-searchbar input::placeholder { color: var(--text-faint); }
.tdt-searchbar__icon { color: var(--text-faint); flex: 0 0 auto; }
.tdt-searchbar button, .tdt-search-btn {
  flex: 0 0 auto; height: 40px; padding: 0 16px; border: 0; cursor: pointer;
  border-radius: var(--r-pill); background: var(--accent); color: #fff;
  font: inherit; font-size: 13.5px; font-weight: 700;
}
.tdt-chips { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tdt-chips::-webkit-scrollbar { display: none; }
.tdt-chip {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  height: 40px; padding: 0 16px; border-radius: var(--r-pill); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  font: inherit; font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.tdt-chip .material-symbols-outlined { font-size: 18px; }
.tdt-chip.is-active, .tdt-chip.bg-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 8px 18px rgba(176, 23, 116, 0.26);
}
.tdt-section { margin-bottom: 26px; }
.tdt-section__title { font-size: var(--step-h2); font-weight: 800; letter-spacing: -0.3px; color: var(--text); margin: 0; }

/* ==========================================================================
   PAINEL ADMIN
   As telas de admin tem componentes proprios; recebem o visual do sistema sem
   reescrever markup. Sidebar e cabecalho seguem o mesmo desenho do cliente.
   ========================================================================== */
.admin-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.admin-card, .admin-kpi-card, .admin-search-stack {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-1);
}
.admin-card:hover, .admin-kpi-card:hover { box-shadow: var(--shadow-2); }
.admin-kpi-number { color: var(--text); font-weight: 800; font-size: 27px; line-height: 1; letter-spacing: -1px; }
.admin-section-title { color: var(--text); font-size: var(--step-h2); font-weight: 800; letter-spacing: -0.3px; }
.admin-search-stack-label { color: var(--text-faint); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.admin-nav-item {
  display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px;
  border-radius: var(--r-sm); color: var(--text-muted); text-decoration: none;
  font-size: 14.5px; font-weight: 600; transition: background 0.15s, color 0.15s;
}
.admin-nav-item .material-symbols-outlined { font-size: 22px; }
.admin-nav-item:hover { background: var(--surface-2); color: var(--text); }
.admin-nav-item.is-active, .admin-nav-item[aria-current="page"], .admin-nav-item.active {
  background: var(--accent); color: #fff; box-shadow: 0 8px 18px rgba(176, 23, 116, 0.26);
}
.admin-nav-item.is-active .material-symbols-outlined,
.admin-nav-item[aria-current="page"] .material-symbols-outlined,
.admin-nav-item.active .material-symbols-outlined { color: #fff; }
.admin-icon-box {
  width: 42px; height: 42px; border-radius: var(--r-sm); display: inline-grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); flex: 0 0 auto;
}
[data-theme="dark"] .admin-icon-box { color: #f472b6; }
.admin-icon-box.teal { background: color-mix(in srgb, #4c1d95 14%, transparent); color: #6d28d9; }
[data-theme="dark"] .admin-icon-box.teal { color: #a78bfa; }
.admin-badge-live {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--r-pill);
  background: color-mix(in srgb, #059669 16%, transparent); color: #047857;
  font-size: 12px; font-weight: 700;
}
[data-theme="dark"] .admin-badge-live { color: #4ade80; }

/* Barra lateral do admin (markup proprio da pagina, com nav > a) */
@media (min-width: 1024px) {
  body[data-page$="_master"] > nav:first-of-type,
  body[data-page="gestao_pontos"] > nav:first-of-type,
  body[data-page="configuracoes_admin"] > nav:first-of-type,
  body[data-page="revenda_painel"] > nav:first-of-type {
    background: var(--surface) !important; border-right: 1px solid var(--border) !important;
  }
}

/* Imagens decorativas do admin nao podem crescer sem limite */
body[data-page$="_master"] img:not([class*="w-"]):not([class*="h-"]) { max-width: 100%; height: auto; }
.admin-header + * img[alt=""], .admin-hero-illustration { max-width: 180px; }
@media (min-width: 1024px) {
  .lg\:flex { display: flex !important; }
  .lg\:grid { display: grid !important; }
  .lg\:block { display: block !important; }
  .lg\:ml-64 { margin-left: 256px; }
  .lg\:pl-64 { padding-left: 256px; }
  .lg\:pl-72 { padding-left: 288px; }
  .lg\:pb-0 { padding-bottom: 0; }
  .lg\:max-w-\[1180px\] { max-width: 1180px; }
}
.w-64 { width: 256px; }
.fixed { position: fixed; }
.top-0 { top: 0; } .left-0 { left: 0; } .right-0 { right: 0; } .bottom-0 { bottom: 0; }
.h-screen { height: 100vh; } .h-full { height: 100%; }
.z-40 { z-index: 40; } .z-50 { z-index: 50; }
.flex-col { flex-direction: column; }
.sticky { position: sticky; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-5xl { max-width: 1024px; } .max-w-7xl { max-width: 1280px; } .max-w-md { max-width: 480px; }
.max-w-\[1600px\] { max-width: 1600px; }
.pt-6 { padding-top: 24px; } .pt-20 { padding-top: 80px; } .pb-24 { padding-bottom: 96px; } .pb-10 { padding-bottom: 40px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.mb-8 { margin-bottom: 32px; } .mb-6 { margin-bottom: 24px; }
.space-y-1 > * + * { margin-top: 4px; }
.space-y-6 > * + * { margin-top: 24px; }
.space-y-8 > * + * { margin-top: 32px; }
.gap-6 { gap: 24px; }

/* Ajustes de layout do admin (markup proprio, sem Tailwind agora) */
.md\:flex-row { }
@media (min-width: 768px) { .md\:flex-row { flex-direction: row; } }
.justify-end { justify-content: flex-end; }
.text-left { text-align: left; }
.ml-1 { margin-left: 4px; } .ml-auto { margin-left: auto; }
.h-9 { height: 36px; } .w-9 { width: 36px; }
.h-10 { height: 40px; } .w-10 { width: 40px; }
.h-8 { height: 32px; } .w-8 { width: 32px; }
.border-2 { border-width: 2px; border-style: solid; }
.rounded-2xl { border-radius: var(--r-md); }
.backdrop-blur { backdrop-filter: blur(12px); }

/* Ilustracoes decorativas (avatar de placeholder, marca d'agua da loja) nao
   podem crescer: sem o Tailwind elas perdiam a medida e ocupavam a tela. */
body[data-page$="_master"] img,
body[data-page="gestao_pontos"] img,
body[data-page="configuracoes_admin"] img,
body[data-page="revenda_painel"] img { max-width: 100%; height: auto; }
body[data-page$="_master"] img[src*="placeholder"],
body[data-page$="_master"] img[alt*="avatar"],
body[data-page$="_master"] img[alt*="profile"] { width: 36px; height: 36px; object-fit: cover; border-radius: 999px; }
body[data-page$="_master"] svg:not([width]) { max-width: 120px; max-height: 120px; }

/* O cabecalho da tela fica a esquerda; o bloco de status vai para a direita */
body[data-page$="_master"] main > section:first-child > div {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
body[data-page$="_master"] main > section:first-child > div > div:first-child { flex: 1; min-width: 240px; }

/* Cartoes de status da gestao de estabelecimentos */
.estabs-status-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: 16px;
}
.estabs-status-label {
  margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-faint);
}
.estabs-status-value { margin: 9px 0 0; font-size: 27px; font-weight: 800; letter-spacing: -1px; color: var(--text); }
.estabs-status-helper { margin: 5px 0 0; font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.estabs-status-card--pending .estabs-status-value { color: var(--tdt-warn, #d97706); }
.estabs-status-card--active .estabs-status-value { color: #059669; }
.estabs-status-card--suspended .estabs-status-value,
.estabs-status-card--rejected .estabs-status-value { color: #e11d48; }
[data-theme="dark"] .estabs-status-card--active .estabs-status-value { color: #4ade80; }
[data-theme="dark"] .estabs-status-card--suspended .estabs-status-value,
[data-theme="dark"] .estabs-status-card--rejected .estabs-status-value { color: #fb7185; }
@media (min-width: 1280px) { .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Campos herdados do markup antigo (classes .field / .lbl) */
.field {
  width: 100%; min-height: 50px; padding: 12px 15px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font: inherit; font-size: 15px; outline: none;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.field.pl-11 { padding-left: 44px; }
.lbl { display: block; margin-bottom: 7px; font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.md\:col-span-2 { grid-column: span 2 / span 2; }
@media (max-width: 767px) { .md\:col-span-2 { grid-column: auto; } }
.app-primary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 50px; border-radius: var(--r-sm); border: 0; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-size: 14.5px; font-weight: 700;
  box-shadow: 0 10px 22px rgba(176, 23, 116, 0.28);
}

/* Botoes herdados (.btn) e icone dentro de campo */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); cursor: pointer;
  font: inherit; font-size: 14.5px; font-weight: 700; text-decoration: none;
}
.btn--primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 10px 22px rgba(176, 23, 116, 0.28);
}
.btn--dark { background: #17131f; border-color: #17131f; color: #fff; }
.btn--neutral { background: var(--surface-2); color: var(--text); }
.btn--block { width: 100%; }
.btn--sm { min-height: 40px; font-size: 13.5px; padding: 0 14px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.left-3 { left: 12px; }
.top-1\/2 { top: 50%; }
.-translate-y-1\/2 { transform: translateY(-50%); }
.relative > .material-symbols-outlined.absolute { color: var(--accent); font-size: 20px; pointer-events: none; }
[data-theme="dark"] .relative > .material-symbols-outlined.absolute { color: #f472b6; }

/* ==========================================================================
   ACABAMENTO GERAL (passada final com captura tela a tela)
   ========================================================================== */

/* 1. Logo e avatar de cabecalho nunca crescem: sem o Tailwind, a marca ficava
      do tamanho da tela na gestao de clientes. */
header img, nav img, aside img, .admin-header img, .profile-appbar img { max-height: 40px; width: auto; }
.admin-header img[alt*="profile"], .admin-header img[alt*="avatar"],
header img[alt*="profile"], header img[alt*="avatar"] { width: 36px; height: 36px; border-radius: 999px; object-fit: cover; }
/* ATENCAO: este guard e so para <img> SEM classe (as ilustracoes soltas que
   viravam banners gigantes quando o Tailwind saiu). Se ele pegar imagens com
   classe, o `height: auto` vence por especificidade e anula a altura de todo
   componente — foi assim que a imagem do beneficio virou um painel de 238px. */
main img:not([class]) { max-width: 100%; height: auto; }
.admin-kpi-card svg, .admin-card svg, main > section svg:not([width]) { max-width: 44px; max-height: 44px; }

/* 2. Coluna do admin: a margem da barra lateral estava sendo somada duas vezes */
@media (min-width: 1024px) {
  body[data-page$="_master"] > main,
  body[data-page="gestao_pontos"] > main,
  body[data-page="configuracoes_admin"] > main {
    margin-left: 264px !important; margin-right: 0 !important;
    max-width: calc(100% - 264px) !important;
    padding: 24px 28px 60px !important;
  }
  body[data-page$="_master"] > .admin-header,
  body[data-page="gestao_pontos"] > .admin-header,
  body[data-page="configuracoes_admin"] > .admin-header { padding-left: 264px; }
}

/* 3. Espacamentos herdados que faltavam */
.p-6 { padding: 24px; } .p-8 { padding: 32px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.pt-4 { padding-top: 16px; } .pt-5 { padding-top: 20px; }
.pb-6 { padding-bottom: 24px; } .pb-8 { padding-bottom: 32px; } .pb-16 { padding-bottom: 64px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.mb-1 { margin-bottom: 4px; } .mb-3 { margin-bottom: 12px; }
.min-h-screen { min-height: 100vh; }
.overflow-y-auto { overflow-y: auto; }
.max-w-3xl { max-width: 768px; }
@media (min-width: 768px) {
  .md\:p-8 { padding: 32px; } .md\:px-6 { padding-left: 24px; padding-right: 24px; }
  .md\:pb-8 { padding-bottom: 32px; } .md\:pb-10 { padding-bottom: 40px; }
}

/* 4. Listas de metrica (linhas rotulo + valor) viram linhas do sistema */
.admin-card ul > li, .admin-card .metric-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2);
  font-size: 14px; color: var(--text);
}
.admin-card ul { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }

/* 5. Blocos roxos herdados (style inline #4c1d95) viram a superficie-heroi */
[style*="background:#4c1d95"], [style*="background: #4c1d95"],
.signature-gradient, .premium-gradient, .loyalty-points-hero, .profile-hero-shell {
  background: var(--hero-bg) !important; color: #fff !important;
  border-radius: var(--r-lg) !important; box-shadow: var(--shadow-hero) !important;
}

/* 6. Linhas de lista do admin: uma linha por registro, nao um bloco empilhado */
@media (min-width: 900px) {
  body[data-page$="_master"] main [class*="divide-y"] > *,
  body[data-page$="_master"] main ul[role="list"] > li {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  }
}
.divide-y > * + * { border-top: 1px solid var(--border); }
.text-ellipsis { text-overflow: ellipsis; }
.whitespace-nowrap { white-space: nowrap; }
.grow, .flex-grow { flex: 1 1 auto; }
.items-baseline { align-items: baseline; }
.gap-1\.5 { gap: 6px; }

/* 7. Cabecalho do admin: marca a esquerda, acoes a direita, tudo numa linha */
.admin-header > div, .admin-header {
  display: flex; align-items: center; gap: 12px; flex-wrap: nowrap;
}
.admin-header { padding: 12px 24px; min-height: 64px; }
.admin-header img { max-height: 32px; }
.admin-header > div:last-child, .admin-header .ml-auto { margin-left: auto; }

/* Cartao de cliente na gestao (desenhado pelo bundle) */
.tdt-client-card {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-1); text-decoration: none; color: var(--text);
}
.tdt-client-card + .tdt-client-card { margin-top: 12px; }
.tdt-client-card__avatar {
  width: 48px; height: 48px; border-radius: var(--r-pill); flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 800; font-size: 16px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
  object-fit: cover;
}
[data-theme="dark"] .tdt-client-card__avatar { color: #f472b6; }
.tdt-client-card__body { flex: 1; min-width: 0; }
.tdt-client-card__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tdt-client-card__name { font-size: 15px; font-weight: 700; color: var(--text); }
.tdt-client-card__mail, .tdt-client-card__meta { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.tdt-client-card__chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--text-muted); }
.tdt-client-card__chips .material-symbols-outlined { font-size: 15px; color: #f0a500; }
.tdt-client-card__actions { margin-left: auto; display: flex; gap: 8px; flex: 0 0 auto; }
.tdt-client-card__actions button, .tdt-client-card__actions a {
  width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer;
}

/* Mensagem de retorno nos formularios de entrada */
.ap-msg {
  margin: 14px 0 0; padding: 12px 14px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; line-height: 1.5; text-align: center;
}
.ap-msg--error { background: color-mix(in srgb, #e11d48 12%, transparent); color: #be123c; }
.ap-msg--success { background: color-mix(in srgb, #059669 14%, transparent); color: #047857; }
.ap-msg--info { background: var(--surface-2); color: var(--text-muted); }
[data-theme="dark"] .ap-msg--error { color: #fb7185; }
[data-theme="dark"] .ap-msg--success { color: #4ade80; }

/* Empresas vinculadas no perfil (cartao desenhado pelo bundle) */
.profile-linked-company-card {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-1); text-decoration: none; color: var(--text);
}
.profile-linked-company-card + .profile-linked-company-card { margin-top: 12px; }
.profile-linked-company-card img { width: 56px; height: 56px; border-radius: var(--r-sm); object-fit: cover; flex: 0 0 auto; background: var(--surface-2); }
.profile-linked-company-card > div { flex: 1; min-width: 0; }
.profile-linked-company-card .flex-wrap { flex-wrap: wrap; }
.bg-slate-100 { background-color: var(--surface-2); }
.text-slate-500 { color: var(--text-muted); }
.rounded-\[22px\] { border-radius: var(--r-sm); }
.leading-tight { line-height: 1.2; }

/* Configuracoes do cliente: coluna unica, cartoes e campos de largura total */
body[data-page="configuracoes_cliente"] main,
body[data-page="configuracoes_cliente"] > div:not(.tdt-sidebar) {
  width: 100%; max-width: 760px; margin: 0 auto; padding: 16px 20px 110px;
}
@media (min-width: 1024px) {
  body[data-page="configuracoes_cliente"] main { max-width: 820px; padding: 24px 28px 60px; }
}
body[data-page="configuracoes_cliente"] main > *,
body[data-page="configuracoes_cliente"] section {
  display: block !important; width: 100%; grid-template-columns: none !important;
}
body[data-page="configuracoes_cliente"] section + section { margin-top: 18px; }
body[data-page="configuracoes_cliente"] input,
body[data-page="configuracoes_cliente"] select {
  width: 100% !important; min-height: 48px; padding: 12px 15px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font: inherit; font-size: 15px; outline: none; margin-top: 6px;
}
body[data-page="configuracoes_cliente"] input:focus,
body[data-page="configuracoes_cliente"] select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
body[data-page="configuracoes_cliente"] label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
body[data-page="configuracoes_cliente"] button { width: 100%; }

/* ==========================================================================
   CORRECOES DE MOBILE (relatadas em uso real)
   ========================================================================== */

/* 1. A pagina nao pode "arrastar" para os lados. A causa principal era o dock
      injetado pelo bundle com 6 itens numa grade fixa de 5 colunas. */
html, body { max-width: 100%; overflow-x: hidden; }
.app-mobile-dock__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 2px; width: 100%; grid-template-columns: none;
}
.app-mobile-dock__item,
.app-mobile-dock [data-mobile-dock-more] {
  flex: 1 1 0; min-width: 0; border: 0; background: none; cursor: pointer;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 48px; border-radius: var(--r-pill); color: var(--dock-text);
  font: inherit; text-decoration: none;
}
.app-mobile-dock__item-label { font-size: 9.5px; font-weight: 600; text-align: center; }

/* 2. Heroi e cartoes nunca ultrapassam a largura da tela */
.ap-hero, .ap-shell, .ap-main, .ap-panel, .profile-hero-shell, .profile-surface-card,
.tdt-hero, .tdt-panel, .wallet-card { max-width: 100%; }
.ap-shell, .ap-main { min-width: 0; }
main img, main svg, .ap-hero img, .profile-hero-shell img { max-width: 100%; }

/* 3. Botao de voltar: era branco com icone azul do tema antigo */
.profile-appbar__btn, .tdt-icon-btn, [data-page-back] {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  width: 42px; height: 42px; border-radius: var(--r-sm);
  display: inline-grid; place-items: center; flex: 0 0 auto;
  box-shadow: none;
}
[data-page-back] .material-symbols-outlined,
.profile-appbar__btn .material-symbols-outlined { color: var(--text) !important; font-size: 22px; }
.profile-appbar__btn--ghost { background: transparent !important; border-color: transparent !important; }

/* 4. Cabecalho no celular: titulo com espaco, botao pequeno e sem esmagar */
@media (max-width: 640px) {
  .tdt-appbar__inner, .profile-appbar__inner, .admin-header { padding: 12px 14px; gap: 10px; }
  .tdt-appbar__hello, .profile-appbar__title { font-size: 18px; letter-spacing: -0.3px; }
  .tdt-appbar__sub { font-size: 12px; }
  .tdt-icon-btn, .profile-appbar__btn, [data-page-back] { width: 38px; height: 38px; }
  .tdt-icon-btn .material-symbols-outlined, [data-page-back] .material-symbols-outlined { font-size: 20px; }
  .ap-hero, .tdt-hero { padding: 20px 18px; border-radius: 22px; }
  .ap-hero__value { letter-spacing: -1.5px; }

  /* O cabecalho do admin tem trilha ("Admin > Dashboard"), selo LIVE e quatro
     botoes numa linha so, sem quebra: no celular o avatar ficava cortado fora
     da tela. O selo e o "Admin >" sao decorativos e saem; o titulo da pagina e
     as acoes ficam. */
  .admin-header .admin-badge-live { display: none; }
  .admin-header > div:first-child > span:nth-child(-n+2) { display: none; }
  .admin-header { gap: 8px; }
  .admin-header > div:first-child { min-width: 0; }
  .admin-header > div:last-child { flex: 0 0 auto; }
}

/* 5. Botao "Cancelar" saia branco com texto branco na gestao de ofertas */
button.btn--neutral, button.btn--ghost, .btn--cancel,
body[data-page="gest_o_de_ofertas_parceiro"] button[id*="ancel"],
body[data-page="minhas_campanhas_loja"] button[id*="ancel"] {
  background: var(--surface-2) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

/* ==========================================================================
   SOBREPOSICOES DO BUNDLE (modal, folha de instalacao, avisos)
   Existiam so no CSS antigo; sem elas o modal de boas-vindas do bonus e o
   passo a passo de instalar apareciam sem forma nas telas migradas.
   ========================================================================== */
/* ATENCAO: o bundle cria .tdt-modal-overlay com createElement e ja da append —
   nunca adiciona .is-open. Se o padrao aqui for display:none, TODO modal do app
   (bonus de adesao, confirmacoes, recibos) nasce invisivel. Por isso o overlay
   ja nasce visivel e so some com .hidden ou display inline. */
.tdt-modal-overlay, .tdt-install-sheet-overlay {
  position: fixed; inset: 0; z-index: 90; display: flex;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(6, 6, 10, 0.6); backdrop-filter: blur(6px);
}
/* A folha de instalar e a unica que e montada uma vez e alternada por classe. */
.tdt-install-sheet-overlay { display: none; }
.tdt-install-sheet-overlay.is-open { display: flex; }
.tdt-modal-overlay.hidden, .tdt-modal-overlay[style*="display: none"] { display: none; }
.tdt-modal-dialog, .tdt-install-sheet {
  position: relative; width: min(440px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4); padding: 26px 22px;
}
.tdt-bonus-modal { text-align: center; }
.tdt-bonus-modal__close, .tdt-install-sheet__close {
  position: absolute; top: 14px; right: 14px; width: 38px; height: 38px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); color: var(--text-muted); display: grid; place-items: center;
}
.tdt-bonus-modal__burst {
  width: 96px; height: 96px; margin: 6px auto 14px; border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 30, 133, 0.35), transparent 70%);
  display: grid; place-items: center;
}
.tdt-bonus-modal__badge {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 16px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--accent-2), var(--accent));
  box-shadow: 0 14px 30px rgba(176, 23, 116, 0.35);
}
.tdt-bonus-modal__badge .material-symbols-outlined { font-size: 38px; }
.tdt-bonus-modal__kicker {
  margin: 0; font-size: 11.5px; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent);
}
[data-theme="dark"] .tdt-bonus-modal__kicker { color: #f472b6; }
.tdt-bonus-modal__title { margin: 8px 0 0; font-size: 22px; font-weight: 800; letter-spacing: -0.4px; }
.tdt-bonus-modal__desc { margin: 10px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--text-muted); }
.tdt-modal-dialog .btn, .tdt-modal-dialog button:not([data-close]) { margin-top: 18px; width: 100%; }

/* Folha "como instalar o app" */
.tdt-install-sheet__head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.tdt-install-sheet__icon { width: 52px; height: 52px; border-radius: var(--r-sm); }
.tdt-install-sheet__title { margin: 0; font-size: 17px; font-weight: 800; }
.tdt-install-sheet__sub { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }
.tdt-install-sheet__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.tdt-install-sheet__steps li { display: flex; gap: 12px; align-items: flex-start; }
.tdt-install-sheet__num {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 800;
}
.tdt-install-step { flex: 1; min-width: 0; }
.tdt-install-step p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-muted); }
.tdt-install-step p b { color: var(--text); }
.tdt-install-step__mock {
  margin-top: 10px; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted);
}
.tdt-install-step__mock--menu { flex-direction: column; align-items: stretch; gap: 6px; }
.tdt-install-step__menu-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 4px; }
.tdt-install-step__menu-row--hot { background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 8px; color: var(--accent); font-weight: 700; }
.tdt-install-step__url { flex: 1; text-align: center; }
.tdt-install-step__confirm { margin-left: auto; padding: 5px 12px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; }
.tdt-install-sheet__foot { margin: 18px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--text-faint); }
.tdt-install-sheet__ok {
  margin-top: 16px; width: 100%; height: 48px; border: 0; border-radius: var(--r-sm); cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-size: 14.5px; font-weight: 700;
}

/* Avisos flutuantes e estado de pagina do bundle */
.tdt-toast, .app-toast, [data-tdt-toast] {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 95;
  max-width: min(420px, calc(100% - 32px)); padding: 13px 18px; border-radius: var(--r-pill);
  background: rgba(20, 20, 27, 0.96); color: #fff; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

/* Dock ancorado nas bordas: depender de left:50% + translate faz o dock
   escorregar se o documento ficar mais largo que a viewport. */
.app-mobile-dock {
  left: 12px; right: 12px; width: auto; transform: none;
  max-width: 430px; margin: 0 auto;
}

/* Trava de largura no celular: nenhuma tela pode arrastar para os lados */
@media (max-width: 760px) {
  body > *, main > *, .ap-main > *, .ap-shell > *, .tdt-home > *,
  .ap-hero > *, .profile-hero-shell > * { max-width: 100%; }
  .ap-shell, .tdt-home, .tdt-panelmain, main { width: 100%; padding-left: 14px; padding-right: 14px; }
  .ap-hero, .tdt-hero, .profile-hero-shell, .ap-panel, .profile-surface-card,
  .tdt-panel, .ap-qr, .admin-card, .admin-kpi-card { width: 100%; }
  .ap-hero__grid { gap: 12px; }
  .ap-ring { width: 84px; height: 84px; }
  .ap-ring svg { width: 84px; height: 84px; }
  /* o brilho decorativo do heroi nao empurra o layout */
  .ap-hero::after, .tdt-hero::after, .profile-hero-shell::after, .ap-qr::after { pointer-events: none; }
}

/* Defesa final contra arrasto lateral no celular */
@media (max-width: 760px) {
  img, video, iframe, table, pre, svg { max-width: 100%; }
  .ap-main > *, .tdt-home > *, main > * { min-width: 0; }
  .ap-hero__value, .tdt-appbar__hello, .profile-appbar__title,
  .ap-card__n, .tdt-row__name, .ap-tx__t { overflow-wrap: anywhere; }
  .ap-quick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .profile-quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tdt-grid-shortcuts, .offer-tool-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tdt-kgrid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Botoes que o bundle desenha e que estavam so como texto */
.app-primary-button, .app-secondary-button, .btn-promo-info, .ui-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 16px; border-radius: var(--r-sm); cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; border: 1px solid transparent;
}
.app-primary-button, .ui-btn--primary, .btn-promo-info {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 10px 22px rgba(176, 23, 116, 0.26);
}
.app-secondary-button, .ui-btn--ghost {
  background: var(--surface-2); color: var(--text); border-color: var(--border); box-shadow: none;
}
.app-primary-button:disabled, .app-secondary-button:disabled, .btn-promo-info:disabled,
.btn-promo-info.cursor-not-allowed {
  background: var(--surface-2); color: var(--text-faint); border-color: var(--border);
  box-shadow: none; cursor: not-allowed;
}
.ui-btn--sm { min-height: 38px; font-size: 13px; padding: 0 12px; }
.app-primary-button .material-symbols-outlined,
.app-secondary-button .material-symbols-outlined { font-size: 19px; }

/* Vitrine no celular: cada empresa vira uma linha compacta, com a foto ao lado
   do texto. Card com foto de 150px empilhada ocupava a tela toda e o nome
   ficava fora do campo de visao. */
@media (max-width: 760px) {
  .tdt-store-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .tdt-store-card { display: flex; align-items: center; gap: 12px; padding: 10px; }
  .tdt-store-card__img {
    width: 92px; height: 92px; flex: 0 0 auto; border-radius: var(--r-sm); overflow: hidden;
  }
  .tdt-store-card__body { padding: 0; flex: 1; min-width: 0; }
  .tdt-store-card__name { font-size: 15px; overflow-wrap: anywhere; }
  .tdt-store-card__badge { top: 6px; left: 6px; font-size: 10px; padding: 3px 7px; }
  /* mesma logica para o carrossel da home */
  .tdt-feat-card { flex: 0 0 200px; }
  .tdt-feat-card__img { height: 128px; }
}

/* Modal de ativar notificacoes (o bundle monta com utilitario puro) */
.bg-slate-950\/45, .bg-slate-900\/50 { background-color: rgba(6, 6, 10, 0.55); backdrop-filter: blur(4px); }
.bg-white\/10 { background-color: rgba(255, 255, 255, 0.10); }
.border-white\/20 { border: 1px solid rgba(255, 255, 255, 0.20); }
.text-white\/82 { color: rgba(255, 255, 255, 0.82); }
.text-slate-500 { color: var(--text-muted); }
.text-slate-400 { color: var(--text-faint); }
.max-w-lg { max-width: 512px; }
.z-50 { z-index: 50; }
.p-4 { padding: 16px; }
@media (min-width: 640px) {
  .sm\:items-center { align-items: center; }
  .sm\:flex-row { flex-direction: row; }
  .sm\:justify-end { justify-content: flex-end; }
}
/* o overlay so faz sentido como flex quando visivel */
.fixed.inset-0.z-50:not(.hidden) { display: flex; }
.fixed.inset-0.z-50 > div,
.fixed.inset-0.z-50 > section {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
  padding: 24px; width: min(520px, 100%); max-height: 88vh; overflow-y: auto;
}

/* ==========================================================================
   BALCAO — resultado da leitura do QR do cliente (validar_resgate.html)
   O caixa opera de pe, com o cliente esperando: alvo grande, uma coluna,
   a acao do dia a dia (carimbar) sempre em primeiro lugar.
   ========================================================================== */
.erc-head { display: flex; align-items: center; gap: 14px; }
.erc-avatar { width: 54px; height: 54px; font-size: 18px; flex: 0 0 auto; }
.erc-head__b { flex: 1; min-width: 0; }
.erc-nome {
  font-size: 19px; font-weight: 800; letter-spacing: -0.4px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.erc-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.erc-pills { display: flex; gap: 8px; margin-top: 13px; flex-wrap: wrap; }
.erc-nota { font-size: 13.5px; line-height: 1.5; color: var(--text-muted); margin: 14px 0 0; }

.erc-prog {
  margin-top: 18px; padding: 15px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
}
.erc-prog__top {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 9px;
}
.erc-prog__top span:last-child { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.erc-prog__rw { font-size: 12.5px; color: var(--text-muted); margin-top: 9px; }

.erc-acoes { display: grid; gap: 10px; margin-top: 18px; }
.erc-acao { width: 100%; height: 54px; font-size: 15.5px; }
.erc-acao .material-symbols-outlined { font-size: 21px; }
.erc-acao--premio {
  background: linear-gradient(90deg, var(--accent-2), var(--accent)); color: #fff;
}
.erc-nova { width: 100%; margin-top: 14px; }
.tdt-btn--done {
  background: color-mix(in srgb, #059669 14%, transparent) !important;
  color: #047857 !important; box-shadow: none !important;
  border: 1px solid color-mix(in srgb, #059669 32%, transparent) !important;
  opacity: 1;
}

/* ==========================================================================
   CORES ARBITRARIAS HERDADAS  (text-[#5b5b62], bg-[#f7f7f7], ...)
   O bundle ainda gera ~350 dessas classes do tema antigo. Sem mapeamento elas
   nao fazem nada: todo texto secundario sai com o mesmo peso do principal e as
   telas ficam sem hierarquia. Mapear para o hex original traria de volta o
   branco-no-branco no tema escuro, entao cada uma vai para o TOKEN equivalente.
   ========================================================================== */
.text-\[\#111b3f\], .text-\[\#111B3F\], .text-\[\#2e2e34\], .text-\[\#191b2c\] { color: var(--text); }
.text-\[\#5b5b62\], .text-\[\#8a8f9c\] { color: var(--text-muted); }
.text-\[\#aeacb4\] { color: var(--text-faint); }
/* O roxo herdado marcava tanto numero grande de KPI quanto rotulo pequeno. Como
   cor de texto ele vira texto normal — pintar rotulo de acento faz a tela
   inteira gritar. O acento fica so onde ele era de fato um icone. */
.text-\[\#4c1d95\] { color: var(--text); }
.material-symbols-outlined.text-\[\#4c1d95\], .text-\[\#b41340\] { color: var(--accent); }

.bg-\[\#f7f7f7\], .bg-\[\#f0f2f8\], .bg-\[\#f0f0f0\], .bg-\[\#e9e7f1\] { background: var(--surface-2); }
.bg-\[\#4c1d95\], .bg-\[\#111B3F\], .bg-\[\#111b3f\] { background: var(--hero-bg); color: #fff; }

.border-\[\#e9e7f1\], .border-\[\#dedbe7\], .border-\[\#e4e7ef\] { border-color: var(--border); }
.border-\[\#4c1d95\], .border-\[\#133f8c\] { border-color: var(--accent); }
