﻿/* ============================================================
   SóHoje Uai — Admin CSS
   Separado do style.css do site público.
   ============================================================ */

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --sombra: 0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.07);
    --sombra-hover: 0 4px 8px rgba(0,0,0,.06), 0 12px 32px rgba(0,0,0,.10);
    --bg-card: linear-gradient(135deg, #ffffff 0%, #e9e2d9 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #f1efed;
    color: #333;
    line-height: 1.5;
    font-size: 15px;
}

/* Painel do parceiro: fundo laranja-claro + cards brancos (não afeta o admin). */
.partner-wrap { background: #fbe9dd; --bg-card: #ffffff; }
.partner-wrap .admin-main { background: transparent; }

/* Barra fixa "Modo admin" (impersonação) — topo inteiro da página. */
.adm-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 9999; height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; background: #b94e27; color: #fff; font-size: .86rem; font-weight: 600; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.adm-bar span { display: inline-flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-bar a { color: #fff; font-weight: 800; white-space: nowrap; text-decoration: underline; }
.adm-bar .icon { width: 1.1em; height: 1.1em; flex-shrink: 0; }
.adm-impersona .sidebar { top: 40px; }
.adm-impersona .admin-main { margin-top: 40px; }
.adm-impersona .topbar { top: 40px; }

a { text-decoration: none; color: inherit; }

/* ── Ícones SVG (herdam a cor do texto) ────────────────────── */
.icon {
    width: 1.15em;
    height: 1.15em;
    display: inline-block;
    vertical-align: -0.18em;
    fill: currentColor;
    flex-shrink: 0;
}

/* ── Layout principal ──────────────────────────────────────── */
.admin-wrap {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    width: 230px;
    background: #ededed;
    min-height: 100vh;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform .25s ease;
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,.18) transparent;
}
/* Chrome / Edge / Safari */
.sidebar::-webkit-scrollbar              { width: 4px; }
.sidebar::-webkit-scrollbar-track       { background: transparent; }
.sidebar::-webkit-scrollbar-thumb       { background: rgba(0,0,0,.18); border-radius: 99px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.32); }

/* Botão hambúrguer (só no mobile) + fundo escuro para fechar */
.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    margin-right: 4px;
    border: none;
    background: none;
    color: #333;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 8px;
}
.menu-toggle:hover { background: #f1efed; }
.menu-toggle .icon { width: 1em; height: 1em; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 150;
}

.sidebar__brand {
    padding: 26px 22px 22px;
    border-bottom: 1px solid rgba(0,0,0,.08);
}

.sidebar__brand-logo {
    display: block;
    width: 150px;
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.sidebar__brand-name {
    color: #DA6438;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -.3px;
}

.sidebar__brand-sub {
    color: rgba(0,0,0,.4);
    font-size: .7rem;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar__nav {
    flex: 1;
    padding: 10px 0;
}

.sidebar__section {
    color: rgba(0,0,0,.38);
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 18px 22px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 22px;
    color: rgba(0,0,0,.62);
    font-size: .86rem;
    font-weight: 500;
    transition: background .15s, color .15s, border-color .15s;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(0,0,0,.06);
    color: rgba(0,0,0,.88);
}

.nav-item.active {
    background: rgba(218,100,56,.12);
    color: #DA6438;
    border-left-color: #DA6438;
    font-weight: 600;
}

.nav-item__icon {
    width: 18px;
    text-align: center;
    font-size: .95rem;
    flex-shrink: 0;
}

.sidebar__footer {
    padding: 10px 0 14px;
    border-top: 1px solid rgba(0,0,0,.08);
}

/* ── Área principal ────────────────────────────────────────── */
.admin-main {
    margin-left: 230px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;   /* flex item pode encolher: evita que conteúdo largo sangre a tela */
}

/* Layout de login (sem sidebar) */
.admin-main--auth {
    margin-left: 0;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2b2b2b 0%, #3d3a37 100%);
}

.admin-main--auth .content {
    width: 100%;
    max-width: 420px;
    padding: 28px;
}

.admin-main--auth .card {
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.admin-main--auth .card h2 {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo {
    display: block;
    width: 180px;
    max-width: 70%;
    height: auto;
    margin: 0 auto 18px;
}

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
    background: #fff;
    border-bottom: 1px solid #e6e3e0;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.topbar__breadcrumb {
    font-size: .83rem;
    color: #969899;
}

.topbar__breadcrumb strong {
    color: #2b2b2b;
    font-weight: 600;
}

.topbar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .83rem;
    color: #555;
}

.topbar__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #DA6438;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}
.topbar__avatar--logo { background: #fff; border: 1px solid #ece6df; overflow: hidden; }
.topbar__avatar--logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Botão "Entrar com Google" (login do parceiro) */
.google-signin { display: flex; flex-direction: column; align-items: center; margin-bottom: 4px; }
.google-signin .g_id_signin { display: flex; justify-content: center; }
.google-signin .auth-sep { display: flex; align-items: center; gap: 10px; width: 100%; margin: 14px 0 2px; color: #969899; font-size: .82rem; }
.google-signin .auth-sep::before, .google-signin .auth-sep::after { content: ''; flex: 1; height: 1px; background: #ece6df; }

/* Login com Facebook (painel do parceiro) */
.fb-signin { display: flex; justify-content: center; margin: 8px 0 2px; }
.fb-login-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    width: 320px; max-width: 100%; padding: 11px 16px;
    background: #1877F2; color: #fff; border: 0; border-radius: 999px;
    font-size: 1rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.fb-login-btn:hover { background: #0f63d6; }
.fb-login-btn svg { flex-shrink: 0; }

/* Seletor de empresa no topo (usuário com mais de uma empresa) */
.topbar__switch { position: relative; }
.topbar__switch > summary { list-style: none; cursor: pointer; }
.topbar__switch > summary::-webkit-details-marker { display: none; }
.topbar__switch-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 6px 4px 10px; border-radius: 999px;
    border: 1px solid #ece6df; background: #faf8f6; transition: background .15s, border-color .15s;
}
.topbar__switch-toggle:hover { background: #f3ece6; border-color: #e0d5ca; }
.topbar__switch-name { font-weight: 600; color: #2b2b2b; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__switch-caret { color: #969899; font-size: .8rem; }
.topbar__switch[open] > summary .topbar__switch-toggle { background: #f3ece6; border-color: #DA6438; }
.topbar__switch-menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
    min-width: 240px; background: #fff; border: 1px solid #ece6df;
    border-radius: 12px; box-shadow: 0 8px 28px rgba(60,40,30,.16); padding: 6px;
}
.topbar__switch-label {
    padding: 6px 12px 4px; font-size: .7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px; color: #969899;
}
.topbar__switch-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    border-radius: 8px; color: #2b2b2b; font-weight: 600; text-decoration: none;
}
.topbar__switch-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__switch-item .icon { width: 1em; height: 1em; color: #969899; flex-shrink: 0; }
.topbar__switch-item:hover { background: #faf8f6; }
.topbar__switch-item.is-active { color: #DA6438; }
.topbar__switch-item.is-active .icon { color: #DA6438; }
.topbar__switch-ok { color: #DA6438 !important; margin-left: auto; }
/* "+ Nova Empresa" — destaque laranja, com separador quando há empresas acima */
.topbar__switch-new { color: #DA6438; font-weight: 700; }
.topbar__switch-new .icon { color: #DA6438; }
.topbar__switch-new:not(:first-child) { margin-top: 4px; border-top: 1px solid #ece6df; border-radius: 0 0 8px 8px; }
.topbar__switch-new:hover { background: #fbeee6; }

/* ── Content ───────────────────────────────────────────────── */
.content {
    padding: 18px 20px;
    flex: 1;
    min-width: 0;     /* idem: segura grids/tabelas largas dentro da área */
    max-width: 100%;
}

/* ── Guardas anti-sangria (valem p/ admin e parceiro) ─────────────────────── */
/* Conteúdo largo (URLs, código, palavras enormes) quebra em vez de empurrar a tela. */
.content pre { white-space: pre-wrap; word-break: break-word; max-width: 100%; overflow-x: auto; }
.content code { overflow-wrap: anywhere; word-break: break-word; }
.content img, .content video, .content canvas, .content svg:not(.icon) { max-width: 100%; height: auto; }
.content h1, .content h2, .content h3, .content h4, .content p, .content li, .content label { overflow-wrap: break-word; }
.content table { max-width: 100%; }

.content__title {
    font-size: 1.08rem;
    font-weight: 700;
    color: #2b2b2b;
    margin-bottom: 14px;
}

/* ── KPI Grid ──────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}

/* Pagamentos: 4 cards (2 col) ao lado de "Receita por tipo"; tabela full width. */
.pay-overview { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; margin-bottom: 18px; }
.pay-overview__cards { grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 0; }
.pay-overview__side { margin: 0; }
@media (max-width: 900px) { .pay-overview { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .pay-overview__cards { grid-template-columns: 1fr; } }

/* Tabela de pagamentos recentes */
.pay-table { width: 100%; }
.pay-who { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.pay-who__ic { width: 26px; height: 26px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pay-who__ic .icon { width: .95em; height: .95em; }
.pay-who__ic--emp { background: #eaf1ff; color: #2b5fd0; }
.pay-who__ic--cli { background: #eafaf0; color: #0a8f3c; }
.pay-table code { background: #f4f1ee; padding: 2px 7px; border-radius: 6px; font-size: .82rem; color: #5c534d; }
.pay-status { text-transform: capitalize; font-weight: 700; font-size: .82rem; }
/* Botão flutuante de suporte no WhatsApp (painel do parceiro) */
.wa-float { position: fixed; right: 18px; bottom: 18px; z-index: 900; display: inline-flex; align-items: center; gap: 9px;
    background: #25D366; color: #fff; padding: 12px 18px; border-radius: 99px; text-decoration: none; font-weight: 800;
    box-shadow: 0 8px 22px rgba(37,211,102,.45); transition: transform .12s, box-shadow .12s; }
.wa-float:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(37,211,102,.55); color: #fff; }
.wa-float .icon { width: 22px; height: 22px; }
@media (max-width: 640px) { .wa-float { padding: 14px; right: 14px; bottom: 14px; } .wa-float__txt { display: none; } }

.lvl-badge { display: inline-flex; align-items: center; gap: 5px; background: #fff3ee; color: #b8481f;
    font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; padding: 2px 9px; border-radius: 99px; }
.lvl-badge .icon { width: .9em; height: .9em; }
/* Nível da empresa no menu (abaixo do nome) */
.sidebar__brand-lvl { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
    background: rgba(218,100,56,.15); color: #ffd9c9; font-weight: 800; font-size: .72rem;
    text-transform: uppercase; letter-spacing: .5px; padding: 4px 12px; border-radius: 99px; text-decoration: none; }
.sidebar__brand-lvl:hover { background: rgba(218,100,56,.3); }
.sidebar__brand-lvl .icon { width: .95em; height: .95em; }

/* Grade de selos de nível (página de conquistas do parceiro) */
.lvl-selos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 16px; margin-top: 14px; }
.lvl-selo { text-align: center; }
.lvl-selo__img { position: relative; width: 92px; height: 92px; margin: 0 auto 8px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; background: #f4f1ee; overflow: hidden; }
.lvl-selo__img img { width: 100%; height: 100%; object-fit: cover; }
.lvl-selo__ph { color: #c9b8ac; }
.lvl-selo__ph .icon { width: 40px; height: 40px; }
.lvl-selo.is-off .lvl-selo__img { filter: grayscale(1); opacity: .55; }
.lvl-selo__lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.15); color: #fff; }
.lvl-selo__lock .icon { width: 26px; height: 26px; }
.lvl-selo__nome { font-weight: 800; color: #241c18; font-size: .92rem; }
.lvl-selo.is-off .lvl-selo__nome { color: #969899; }
.lvl-selo__meta { font-size: .74rem; color: #969899; }
.lvl-selo.is-on .lvl-selo__meta { color: #0a8f3c; font-weight: 700; }

/* Página de Clientes do parceiro */
.cli-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.cli-search { flex: 1 1 260px; min-width: 0; padding: 9px 12px; border: 1px solid #e2dcd6; border-radius: 9px; }
.cli-ord { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.cli-ord__label { font-size: .82rem; color: #969899; font-weight: 600; }
.cli-ord__btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 99px;
    background: #f4f1ee; color: #5c534d; font-weight: 700; font-size: .82rem; text-decoration: none; border: 1.5px solid transparent; }
.cli-ord__btn .icon { width: .95em; height: .95em; }
.cli-ord__btn:hover { background: #ece7e2; }
.cli-ord__btn.is-on { background: #fff3ee; color: #b8481f; border-color: #DA6438; }
.cli-table .c-acts { white-space: nowrap; }
.cli-table .btn-icon.has-obs { color: #DA6438; background: #fff3ee; }
.cli-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.cli-pager__info { font-size: .82rem; color: #969899; }
.cli-data { border: 1px solid #eee6df; border-radius: 12px; overflow: hidden; margin-top: 8px; }
.cli-data__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; border-bottom: 1px solid #f2ece6; }
.cli-data__row:last-child { border-bottom: 0; }
.cli-data__row span { color: #8a8078; font-size: .84rem; display: inline-flex; align-items: center; gap: 7px; }
.cli-data__row span .icon { width: .95em; height: .95em; color: #DA6438; }
.cli-data__row strong { color: #241c18; text-align: right; word-break: break-word; }
.pay-status--confirmado { color: #0a8f3c; }
.pay-status--pendente { color: #c99400; }
.pay-status--reembolsado { color: #8a5cd0; }
.pay-status--cancelado, .pay-status--falhou { color: #c0392b; }

.kpi-card {
    border-radius: 14px;
    padding: 22px 20px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 6px 24px rgba(0,0,0,.12);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    right: -24px; top: -24px;
    width: 110px; height: 110px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
}

.kpi-card::after {
    content: '';
    position: absolute;
    right: 10px; bottom: -30px;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
}

.kpi-card--orange { background: linear-gradient(135deg, #DA6438 0%, #e88a62 100%); }
.kpi-card--teal   { background: linear-gradient(135deg, #1f9d63 0%, #5fd98a 100%); }
.kpi-card--purple { background: linear-gradient(135deg, #b5742e 0%, #e0a45a 100%); }
.kpi-card--navy   { background: linear-gradient(135deg, #3d3a37 0%, #5b554f 100%); }
.kpi-card--gold   { background: linear-gradient(135deg, #c79a3a 0%, #e8c878 100%); }

.kpi-card__icon {
    font-size: 2.1rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.kpi-card__body {
    position: relative;
    z-index: 1;
}

.kpi-card__label {
    font-size: .72rem;
    opacity: .85;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 5px;
}

.kpi-card__value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1px;
}

.kpi-card__sub {
    font-size: .72rem;
    opacity: .7;
    margin-top: 4px;
}

/* ── Dashboard grid ────────────────────────────────────────── */
.dashboard-row {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 18px;
    margin-bottom: 20px;
}

.dashboard-row--equal {
    grid-template-columns: 1fr 1fr;
}

.dashboard-row--full {
    grid-template-columns: 1fr;
}

/* Margem extra acima dos gráficos, separando da visão geral/pendências. */
.dashboard-row--spaced {
    margin-top: 28px;
}

/* Topo do dashboard: visão geral (60%) à esquerda, pendências (40%) à direita. */
.dash-top {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 18px;
    margin-bottom: 20px;
    align-items: start;
}

/* ── Widget ────────────────────────────────────────────────── */
.widget {
    background: #fff;
    border: 1px solid #ece6df;
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: var(--sombra);
    min-width: 0;       /* permite encolher dentro do grid (evita "sangrar") */
    overflow: hidden;   /* contém conteúdo largo (gráficos) dentro do card */
}

.widget__title {
    font-size: .82rem;
    font-weight: 700;
    color: #2b2b2b;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1efed;
}

.widget__empty {
    color: #969899;
    font-size: .85rem;
    padding: 12px 0;
    text-align: center;
}

/* ── Donut Chart ───────────────────────────────────────────── */
.donut-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.donut {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: #dcdcdc;
    flex-shrink: 0;
}

.donut__hole {
    position: absolute;
    width: 90px; height: 90px;
    background: #fff;
    border-radius: 50%;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}

.donut__hole-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2b2b2b;
    line-height: 1;
}

.donut__hole-label {
    font-size: .6rem;
    color: #969899;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-top: 2px;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: 100%;
}

.donut-legend__item {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .8rem;
    color: #555;
}

.donut-legend__dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.donut-legend__name { flex: 1; }

.donut-legend__pct {
    font-size: .75rem;
    color: #969899;
    margin-right: 6px;
}

.donut-legend__count {
    font-weight: 700;
    color: #2b2b2b;
    min-width: 20px;
    text-align: right;
}

/* ── Generic card ──────────────────────────────────────────── */
.card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: var(--sombra);
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
}

/* Marca d'água de ícone no canto esquerdo superior dos cards */
.card-wm {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 30%;
    aspect-ratio: 1 / 1;
    opacity: .1;
    pointer-events: none;
    color: #DA6438;
    z-index: 0;
}
.card-wm .icon { width: 50%; height: 50%; display: block; }

.card h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #2b2b2b;
    margin-bottom: 12px;
}

.card h3 {
    font-size: .85rem;
    font-weight: 700;
    color: #2b2b2b;
    margin: 14px 0 9px;
    padding-top: 11px;
    border-top: 1px solid #f1efed;
}

.card h3:first-of-type { margin-top: 0; border-top: none; padding-top: 0; }

/* ── Form ──────────────────────────────────────────────────── */
form { display: grid; gap: 13px; }

label {
    display: block;
    font-size: .76rem;
    font-weight: 600;
    color: #4a4a4a;
    margin-bottom: 3px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #dcdcdc;
    border-radius: 7px;
    font-size: .84rem;
    color: #333;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    font-family: inherit;
}

/* Mostrar/ocultar senha (ícone de olho) */
.pw-field { position: relative; display: block; }
.pw-field > input { display: block; width: 100%; padding-right: 38px; margin-bottom: 0 !important; }
.pw-field .pw-toggle { position: absolute; top: 50%; transform: translateY(-50%); right: 4px; margin: 0 !important; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; padding: 0; cursor: pointer; color: #969899; }
.pw-field .pw-toggle svg { width: 17px; height: 17px; fill: currentColor; display: block; }
.pw-field .pw-toggle:hover { color: #DA6438; }

input:focus, select:focus, textarea:focus {
    border-color: #DA6438;
    box-shadow: 0 0 0 3px rgba(218,100,56,.1);
}

button, button[type="submit"] {
    padding: 5px 15px;
    background: #DA6438;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
    font-family: inherit;
}

button:hover  { background: #c0532a; }
button:active { transform: scale(.98); }

.field-help {
    display: block;
    font-size: .72rem;
    color: #94a3b8;
    margin-top: 2px;
}

/* ── Toggle switch ─────────────────────────────────────────── */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}

.toggle-switch-label {
    position: relative;
    display: inline-block;
    width: 48px; height: 26px;
    background: #cbd5e1;
    border-radius: 99px;
    cursor: pointer;
    transition: background .2s;
    flex-shrink: 0;
}

.toggle-switch-label::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 20px; height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: left .2s;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.toggle-switch input:checked + .toggle-switch-label { background: #22c55e; }
.toggle-switch input:checked + .toggle-switch-label::after { left: 25px; }

.toggle-switch span { font-size: .85rem; color: #4a4a4a; }

/* ── Table ─────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }

table th, table td {
    padding: 11px 12px;
    text-align: left;
    font-size: .82rem;
    border-bottom: 1px solid #f1efed;
}

table th {
    font-size: .72rem;
    font-weight: 700;
    color: #969899;
    text-transform: uppercase;
    letter-spacing: .5px;
}

table tbody tr:last-child td { border-bottom: none; }
table tbody tr:hover { background: #faf7f5; }

/* ── Badge ─────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 600;
}

.badge-ativa     { background: #dcfce7; color: #166534; }
.badge-pendente  { background: #fef9c3; color: #854d0e; }
.badge-rascunho  { background: #eeeeee; color: #4a4a4a; }
.badge-expirada  { background: #fee2e2; color: #991b1b; }
.badge-cancelada { background: #fce7f3; color: #9d174d; }
.badge-concluida { background: #dcfce7; color: #166534; }
.badge-falhou    { background: #fee2e2; color: #991b1b; }
.badge-ativo     { background: #dcfce7; color: #166534; }
.badge-suspenso  { background: #fee2e2; color: #991b1b; }
.badge-pendente-aprovacao { background: #fef9c3; color: #854d0e; }

/* ── Alert ─────────────────────────────────────────────────── */
.alert {
    padding: 13px 18px;
    border-radius: 10px;
    font-size: .88rem;
    margin-bottom: 20px;
    border-left: 4px solid #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.alert.success {
    border-left-color: #22c55e;
    background: #f0fdf4;
    color: #15803d;
}

/* ── Botão secundário ──────────────────────────────────────── */
.btn-secondary {
    background: #fff;
    color: #DA6438;
    border: 1.5px solid #DA6438;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    width: 100%;
}
.btn-secondary:hover { background: #fff5f1; }

/* ── Linha de checkbox amigável ────────────────────────────── */
.check-line {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 11px;
    border: 1px solid #dcdcdc;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 500;
    color: #4a4a4a;
    font-size: .82rem;
    margin-bottom: 5px;
    transition: border-color .15s, background .15s;
}
.check-line:hover { border-color: #DA6438; background: #fffaf8; }
.check-line input[type="checkbox"] { width: 18px; height: 18px; accent-color: #DA6438; cursor: pointer; }
.check-line span { margin: 0; font-weight: 500; }

/* ── Editor de pacotes de token ────────────────────────────── */
.pkg-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.pkg-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1.5px solid #dcdcdc;
    border-radius: 10px;
    padding: 12px 14px;
}

.pkg-field {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1.5px solid #dcdcdc;
    border-radius: 8px;
    padding: 4px 10px;
}

.pkg-field:focus-within { border-color: #DA6438; }

.pkg-field input {
    border: none;
    padding: 5px 2px;
    width: 70px;
    font-size: .95rem;
    font-weight: 600;
    text-align: center;
    outline: none;
}

.pkg-unit { font-size: .8rem; color: #969899; font-weight: 600; white-space: nowrap; }
.pkg-by   { font-size: .82rem; color: #969899; }

.pkg-remove {
    margin-left: auto;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    width: 30px; height: 30px;
    border-radius: 8px;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background .15s;
}
.pkg-remove:hover { background: #fecaca; }

/* ── Caixa de exemplo ao vivo ──────────────────────────────── */
.cost-example {
    background: #fff5f1;
    border: 1px solid #f5d9cc;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: .88rem;
    color: #7a3a1f;
    margin-top: 6px;
}
.cost-example strong { color: #DA6438; }

/* ── Grupo de menu (dropdown sanfona) ──────────────────────── */
.nav-group__header {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 11px 22px;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    color: rgba(0,0,0,.62);
    font-size: .86rem;
    font-weight: 500;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.nav-group__header:hover { background: rgba(0,0,0,.06); color: rgba(0,0,0,.88); }
.nav-group__caret { margin-left: auto; font-size: .7rem; transition: transform .2s; }
.nav-group.open .nav-group__caret { transform: rotate(180deg); }
.nav-group.open .nav-group__header { color: rgba(0,0,0,.9); }
.nav-group__items { display: none; }
.nav-group.open .nav-group__items { display: block; }
.nav-group__items .nav-item { padding-left: 48px; font-size: .82rem; }

/* ── Cabeçalho de card com ação à direita ──────────────────── */
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.card-head h3 { margin: 0; padding: 0; border: none; }

.btn-block { width: 100%; justify-content: center; }

.btn-dark {
    background: #2b2b2b;
    color: #fff;
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: .82rem;
    cursor: pointer;
    flex-shrink: 0;
}
.btn-dark:hover { background: #3d3a37; }

.toggle-box {
    margin-top: 14px;
}

/* ── Busca de tabela ───────────────────────────────────────── */
.table-search {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 12px;
    border: 1.5px solid #dcdcdc;
    border-radius: 8px;
    font-size: .88rem;
    outline: none;
}
.table-search:focus { border-color: #DA6438; box-shadow: 0 0 0 3px rgba(218,100,56,.1); }

/* ── Tabela editável (localidades) ─────────────────────────── */
.loc-table { display: flex; flex-direction: column; }
.loc-thead, .loc-trow {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 4px;
    border-bottom: 1px solid #f1efed;
}
.loc-thead {
    font-size: .68rem;
    font-weight: 700;
    color: #969899;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.col-nome { flex: 2 1 0; min-width: 0; }
.col-nivel  { flex: 0 0 46px; text-align: center; }
.col-limiar { flex: 0 0 92px; }
.col-selo   { flex: 0 0 130px; min-width: 0; }
.loc-trow select.col-selo { padding: 6px 8px; font-size: .82rem; }
@media (max-width: 620px) {
    #tbl-niveis .loc-thead { display: none; }
    #tbl-niveis .loc-trow { flex-wrap: wrap; align-items: center; gap: 6px; }
    #tbl-niveis .col-nome { flex: 1 1 55%; }
    #tbl-niveis .col-selo { flex: 1 1 100%; }
}
.col-uf   { flex: 0 0 76px; text-align: center; }
.col-parent { flex: 1.4 1 0; color: #666; font-size: .8rem; }
.col-actions { flex: 0 0 auto; display: flex; gap: 6px; }
.loc-status { flex: 0 0 120px; }
.loc-check  { flex: 0 0 90px; }
.loc-trow input[type="text"] { padding: 7px 10px; font-size: .82rem; }
.loc-trow select.col-parent { padding: 6px 8px; font-size: .82rem; color: #1a1a1a; background: #fff; border: 1px solid #d9dadb; border-radius: 6px; }
.loc-trow .loc-status { padding: 7px 8px; font-size: .8rem; }
.loc-trow .loc-check { display: flex; align-items: center; gap: 5px; font-size: .78rem; color: #4a4a4a; }
.loc-trow .col-actions button { padding: 7px 12px; font-size: .78rem; }
.loc-empty { color: #969899; font-size: .85rem; padding: 14px 4px; }

/* Banners da vitrine */
.banner-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 14px 0;
    border-top: 1px solid var(--borda, #e7e3df);
}
.banner-row:first-of-type { border-top: none; }
.banner-row__preview {
    flex: 0 0 250px;
    aspect-ratio: 8 / 3;
    background: #f0f0f0 center / cover no-repeat;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}
.banner-row__fields { flex: 1 1 auto; min-width: 0; }
.banner-row__fields label { display: block; font-size: .72rem; color: #666; margin: 6px 0 2px; }
.banner-row__fields input[type="text"],
.banner-row__fields input[type="number"] { width: 100%; padding: 7px 10px; font-size: .85rem; }
.banner-row__inline { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.banner-row__inline .check-line { margin-top: 0; }
.banner-row__actions { display: flex; gap: 8px; margin-top: 10px; }
.banner-config__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Estrela de destaque na tabela de promoções do parceiro */
.promo-star { color: #b9bcbf; background: transparent; border: 1px solid #e0e0e0; cursor: pointer; }
button.promo-star:hover { color: #f0a500; border-color: #f0a500; }
.promo-star--on { color: #f0a500; border-color: #f6d488; background: #fff9ec; cursor: default; }

/* Vitrine de conquistas (painel do parceiro) */
.conq-vitrine { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.conq-badge { border: 1px solid var(--borda, #e7e3df); border-radius: 14px; padding: 14px 12px; text-align: center; background: #fff; }
.conq-badge__img { width: 88px; height: 88px; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; }
.conq-badge__img img { width: 88px; height: 88px; object-fit: contain; }
.conq-badge__img .icon { width: 52px; height: 52px; color: #c9ccce; }
.conq-badge__nome { font-size: .85rem; font-weight: 700; color: #2b2b2b; line-height: 1.2; }
.conq-badge__desc { font-size: .72rem; color: #888; margin-top: 3px; line-height: 1.25; }
.conq-badge__status { font-size: .78rem; font-weight: 600; color: #969899; margin-top: 8px; }
.conq-badge__ok { color: #1f9d63; display: inline-flex; align-items: center; gap: 4px; }
.conq-badge__ok .icon { width: 1em; height: 1em; }
.conq-badge__soon { color: #b9bbbc; font-style: italic; font-weight: 500; }
.conq-badge.is-off { opacity: 1; }
.conq-badge.is-off .conq-badge__img img { filter: grayscale(1) brightness(1.8) contrast(.55); opacity: .05; }
.conq-badge.is-soon { opacity: .85; }
.conq-badge.is-soon .conq-badge__img img { filter: grayscale(1) brightness(1.95) contrast(.5); opacity: .05; }
.conq-badge.is-on { border-color: #f6d488; background: linear-gradient(160deg,#fffdf7,#fff6e6); }
.conq-badge.is-off .conq-badge__nome, .conq-badge.is-soon .conq-badge__nome,
.conq-badge.is-off .conq-badge__desc, .conq-badge.is-soon .conq-badge__desc,
.conq-badge.is-off .conq-badge__status, .conq-badge.is-soon .conq-badge__status { color: #d2d5d7; }
.conq-grupo { font-size: .95rem; font-weight: 800; color: #2b2b2b; margin: 16px 0 9px; }
.conq-grupo:first-of-type { margin-top: 2px; }

/* Conquistas (catálogo no admin) */
.conq-row { padding: 10px 0; border-top: 1px solid #f1efed; display: block; }
.conq-row:first-of-type { border-top: none; }
.conq-row.is-off { opacity: .55; }
.conq-row__head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.conq-row__metric { font-size: .76rem; color: #777; }
.conq-naoimpl { display: inline-flex; align-items: center; gap: 4px; font-size: .68rem; font-weight: 700; color: #b45309; background: #fff4e5; border: 1px solid #f6d488; border-radius: 99px; padding: 2px 8px; }
.conq-naoimpl .icon { width: .85em; height: .85em; }
.conq-row__fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.conq-f { display: flex; flex-direction: column; gap: 2px; }
.conq-f label { font-size: .68rem; color: #777; margin: 0; }
.conq-f--tit { flex: 1 1 160px; }
.conq-f--desc { flex: 2 1 220px; }
.conq-f--tk input { width: 76px; }
.conq-row__fields .check-line { margin: 0; }
.conq-row__fields input[type="text"], .conq-row__fields input[type="number"], .conq-row__fields select { padding: 6px 8px; font-size: .82rem; }
.conq-f--ativo { align-items: flex-start; }
.conq-row__fields .toggle-switch-label { width: 42px; height: 23px; }
.conq-row__fields .toggle-switch-label::after { width: 17px; height: 17px; }
.conq-row__fields .toggle-switch input:checked + .toggle-switch-label::after { left: 22px; }
.conq-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: center; padding: 12px; margin-top: 8px; background: rgba(250,248,246,.94); backdrop-filter: blur(4px); border-top: 1px solid #ece7e2; border-radius: 12px; }
.conq-savebar button { min-width: 280px; justify-content: center; }

/* Catálogo de selos (emblemas) */
.selo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.selo-card { border: 1px solid var(--borda, #e7e3df); border-radius: 12px; padding: 12px; text-align: center; background: #fff; }
.selo-card--off { opacity: .5; }
.selo-card__img { width: 72px; height: 72px; object-fit: contain; display: block; margin: 0 auto 8px; }
.selo-card__nome { font-size: .82rem; font-weight: 600; color: #333; margin-bottom: 8px; word-break: break-word; }
.selo-card__acts { display: flex; justify-content: center; gap: 6px; }

/* Árvore de interesses (categorias + subcategorias) na criação de segmento */
.seg-tree { border: 1px solid var(--borda, #e7e3df); border-radius: 8px; padding: 8px 10px; max-height: 280px; overflow-y: auto; }
.seg-tree__cat { padding: 4px 0; border-top: 1px solid #f1efed; }
.seg-tree__cat:first-child { border-top: none; }
.seg-tree__catlabel { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: .85rem; }
.seg-tree__subs { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 6px 0 4px 24px; }
.seg-tree__sub { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; color: #555; cursor: pointer; }
.seg-tree input[type="checkbox"] { width: 15px; height: 15px; accent-color: #DA6438; cursor: pointer; }

/* Filtro segmentado (abas viram pílulas dentro da tabela) */
.seg-filter { display: inline-flex; gap: 4px; background: #f1efed; border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.seg-filter__btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 8px; font-size: .8rem; font-weight: 600; color: #6b6b6b; text-decoration: none; transition: background .12s, color .12s; }
.seg-filter__btn .icon { width: .9em; height: .9em; }
.seg-filter__btn:hover { color: #DA6438; }
.seg-filter__btn.is-active { background: #fff; color: #DA6438; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
@media (max-width: 640px) {
    .banner-row { flex-direction: column; }
    .banner-row__preview { flex-basis: auto; width: 100%; }
}

/* ── Linha de edição (localidades) ─────────────────────────── */
.loc-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.loc-row input[type="text"] { padding: 7px 10px; font-size: .82rem; }
.loc-row .loc-uf { width: 72px; flex-shrink: 0; text-align: center; }
.loc-row button {
    padding: 7px 12px;
    font-size: .78rem;
    flex-shrink: 0;
}
.btn-danger  { background: #fee2e2; color: #dc2626; font-weight: 700; line-height: 1; }
.btn-danger:hover  { background: #fecaca; }
.btn-sm.btn-salmon,
a.btn-salmon       { background: #f9a8d4; color: #831843; font-weight: 700; }
.btn-sm.btn-salmon:hover,
a.btn-salmon:hover { background: #DA6438; color: #fff; }
.btn-sm.btn-red,
a.btn-red          { background: #fca5a5; color: #7f1d1d; font-weight: 700; }
.btn-sm.btn-red:hover,
a.btn-red:hover    { background: #b91c1c; color: #fff; }

/* ── Barra de progresso ────────────────────────────────────── */
.progress {
    background: #eeeeee;
    border-radius: 99px;
    height: 22px;
    overflow: hidden;
    margin-top: 4px;
}
.progress__bar {
    background: linear-gradient(90deg, #DA6438, #e88a62);
    color: #fff;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 700;
    min-width: 30px;
    transition: width .4s ease;
}

.btn-cta {
    display: inline-block;
    margin-top: 14px;
    background: #DA6438;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: .88rem;
}
.btn-cta:hover { background: #c0532a; }

/* ── Section title dentro de card ──────────────────────────── */
.section-title {
    font-size: .78rem;
    font-weight: 700;
    color: #969899;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 28px 0 14px;
    padding-top: 22px;
    border-top: 1px solid #f1efed;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
    .dashboard-row,
    .dashboard-row--equal,
    .dash-top { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-230px); }
    .admin-main { margin-left: 0; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .content { padding: 18px; }

    .menu-toggle { display: inline-flex; }
    .topbar__breadcrumb { margin-right: auto; }
    .admin-wrap.menu-open .sidebar { transform: translateX(0); }
    .admin-wrap.menu-open .sidebar-overlay { display: block; }

    /* Topbar enxuta no mobile — não sangra a tela */
    .topbar { padding: 10px 14px; gap: 8px; }
    .topbar__breadcrumb { display: none; }
    .topbar__user { margin-left: auto; gap: 7px; min-width: 0; }
    .topbar__user > span { display: none; }   /* nome da empresa/admin */
    .topbar__user .badge { display: none; }    /* status */
    .topbar__switch-name { display: none; }    /* nome da empresa vazava — no mobile fica só a logo */
    .topbar__switch-caret { display: none; }
    .topbar__switch-toggle { padding: 2px; border: none; background: transparent; }
    .topbar__buy { padding: 5px 9px; gap: 3px; }   /* compacto: só ícones (+ moeda) */
    .topbar__buy-text { display: none; }
    .topbar__buy-coin { display: inline-flex; }
    .topbar__tokens { padding: 4px 9px; font-size: .78rem; }
    .topbar__avatar { width: 30px; height: 30px; font-size: .8rem; }
    .cartw__panel { width: min(290px, calc(100vw - 20px)); }

    /* qfloat: barra fixa no bottom com info + botões de ação */
    #promocao-form .qfloat {
        position: fixed;
        bottom: 0; top: auto;
        left: 0; right: 0;
        z-index: 99;
        border-radius: 0;
        border: none;
        border-top: 1px solid #e6e3e0;
        padding: 10px 16px;
        margin-bottom: 0;
        display: flex !important;
        flex-direction: column;
        gap: 8px;
        box-shadow: 0 -3px 14px rgba(0,0,0,.10);
    }
    /* Linha de info: label | custo | rótulo (compacto, sem barra) */
    #promocao-form .qfloat .qfloat__info {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    #promocao-form .qfloat .qfloat__hint,
    #promocao-form .qfloat .qfloat__retorno,
    #promocao-form .qfloat .qfloat__destaque,
    #promocao-form .qfloat .qfloat__help { display: none; }
    #promocao-form .qfloat .qfloat__label  { flex-shrink: 0; white-space: nowrap; font-size: .68rem; }
    #promocao-form .qfloat .qfloat__cost   { font-size: 1.15rem; margin-top: 0; white-space: nowrap; }
    #promocao-form .qfloat .qfloat__aprox  { display: inline; font-size: .68rem; }
    /* Linha da barra: rótulo à esquerda + barra ocupando o resto */
    #promocao-form .qfloat .qfloat__bar-row {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    #promocao-form .qfloat .qfloat__quality { font-size: .7rem; white-space: nowrap; flex-shrink: 0; }
    #promocao-form .qfloat .qfloat__meter   { flex: 1; margin: 0; }
    /* Proporções mobile: salvar 25% | publicar 50% | ajuda 25% */
    #promocao-form .qfloat .qf-btn--save    { flex: 1; padding: 5px 15px; }
    #promocao-form .qfloat .qf-btn--publish { flex: 3; padding: 5px 15px; }
    #promocao-form .qfloat .qf-btn--help    { display: inline-flex; flex: 1; padding: 5px 15px; background: #25D366; color: #fff; }
    #promocao-form .qfloat .qf-btn--help:hover { background: #1ebe57; }
    /* form-actions convencional fica escondido no mobile */
    #promocao-form .form-actions { display: none; }
    /* Compensação de espaço (~120px de barra) */
    #promocao-form:has(#qfloat:not([hidden])) { padding-bottom: 128px; }
}

@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Restaurados — usados por admin (empresas) e pelo painel da Empresa
   (stylesheet compartilhado). NÃO remover sem conferir os HTMLs.
   ============================================================ */

/* Alerta de aviso (laranja) — ex.: promoção salva como rascunho */
.alert.warning {
    border-left-color: #DA6438;
    background: #fdf1ea;
    color: #97431f;
}

/* Botão cinza (ações neutras, ex.: Salvar Rascunho) */
.btn-gray { background: #969899; color: #fff; }
.btn-gray:hover { background: #7f8182; }

/* Botão Publicar sem saldo: cinza claro, desabilitado */
button:disabled, button[disabled] {
    background: #dcdcdc;
    color: #8a8c8d;
    cursor: not-allowed;
}
button:disabled:hover, button[disabled]:hover { background: #dcdcdc; }

/* Link estilizado como botão laranja (ex.: Comprar Tokens) */
.btn-laranja {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 15px;
    background: #DA6438;
    color: #fff;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
}
.btn-laranja:hover { background: #c0532a; }
.btn-laranja .icon { width: .95em; }

/* Linha de botões lado a lado (ex.: Salvar Rascunho / Publicar) */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

/* Espaçamento dos campos dentro dos cards de formulário (parceiro) */
.form-section__fields { display: grid; gap: 6px; }
.form-section__fields .dashboard-row { margin-bottom: 0; }
.form-section__fields .check-line { margin-bottom: 0; }

/* "Produto e preços" em 2 colunas: campos à esquerda, foto + check à direita */
.produto-grid { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
.produto-grid__main { display: grid; gap: 6px; }
.produto-grid__main .dashboard-row { margin-bottom: 0; }
.produto-grid__side { display: grid; gap: 10px; align-content: start; }
.produto-grid__side .check-line { margin-bottom: 0; }
@media (max-width: 820px) { .produto-grid { grid-template-columns: 1fr; } }

/* ── Configurações em cards (2–3 colunas, fluxo masonry) ────── */
.settings-title { margin: 0 0 16px; }
.settings-grid { column-count: 2; column-gap: 18px; }
.settings-grid > .settings-card {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    margin: 0 0 18px;
    display: block;
}
.settings-card h3 { margin-top: 0; }
.settings-card > h3 + p { margin-top: 0; }
.settings-save {
    margin-top: 4px;
    padding: 12px 28px;
    font-size: .95rem;
}
@media (min-width: 1400px) { .settings-grid { column-count: 3; } }
@media (max-width: 720px)  { .settings-grid { column-count: 1; } }

/* ── Seção avançada recolhível (ex.: pesos do motor de qualidade) ── */
.settings-advanced { margin: 10px 0 6px; border: 1px solid #e6e3e0; border-radius: 10px; padding: 0 14px; background: #faf7f5; }
.settings-advanced > summary { cursor: pointer; font-weight: 700; padding: 12px 2px; color: #DA6438; list-style: none; }
.settings-advanced > summary::-webkit-details-marker { display: none; }
.settings-advanced > summary::before { content: '\25B8\00a0'; }
.settings-advanced[open] > summary::before { content: '\25BE\00a0'; }
.settings-advanced h4 { margin: 16px 0 4px; font-size: .9rem; color: #333; border-top: 1px solid #e6e3e0; padding-top: 14px; }
.settings-advanced h4:first-of-type { border-top: none; padding-top: 4px; }

/* ── Horários por dia da semana ─────────────────────────────── */
.dia-bloco { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.dia-bloco__nome { width: 42px; font-size: .85rem; color: #969899; padding-top: 8px; flex-shrink: 0; }
.dia-ranges { flex: 1; }
.dia-range { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.dia-range .dia-de, .dia-range .dia-ate { width: auto; }
.dia-add { padding: 6px 11px; font-size: 1rem; line-height: 1; background: #969899; }
.dia-add:hover { background: #7f8182; }
.dia-rm { padding: 6px 11px; font-size: 1rem; line-height: 1; }

/* ── Card flutuante: custo para publicar (motor de qualidade) ── */
.qfloat {
    background: var(--bg-card);
    border: 1px solid #e6e3e0;
    border-radius: 14px;
    box-shadow: var(--sombra-hover);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.qfloat__label {
    display: flex; align-items: center; gap: 6px;
    font-size: .72rem; color: #969899; text-transform: uppercase; letter-spacing: .5px; font-weight: 700;
}
.qfloat__label .icon { width: 1em; }
.qfloat__cost { font-size: 2.1rem; font-weight: 800; color: #DA6438; line-height: 1.1; margin-top: 4px; }
.qfloat__destaque { font-size: .82rem; font-weight: 700; color: #c0532a; margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.qfloat__destaque[hidden] { display: none; }
.qfloat__destaque::before { content: '\2605'; } /* estrela */
.qfloat__unit { font-size: .8rem; font-weight: 600; color: #969899; }
.qfloat__aprox { font-size: .72rem; font-weight: 500; color: #b9bbbc; display: inline-block; }
.qfloat__meter { height: 8px; background: #eeeeee; border-radius: 99px; margin: 12px 0 7px; overflow: hidden; }
.qfloat__bar { height: 100%; width: 0; border-radius: 99px; background: #969899; transition: width .25s ease, background .25s ease; }
.qfloat__quality { font-size: .84rem; color: #333; }
.qfloat__quality strong { text-transform: capitalize; }
.qfloat__retorno {
    display: flex; align-items: flex-start; gap: 6px;
    margin: 9px 0 0; padding: 8px 10px;
    background: #eaf6ee; border: 1px solid #cfe9d8; border-radius: 9px;
    font-size: .76rem; color: #1f6d44; line-height: 1.4;
}
.qfloat__retorno .icon { width: 1em; height: 1em; color: #1f9d63; flex-shrink: 0; margin-top: .1em; }
.qfloat__retorno strong { color: #176638; }
.qfloat__retorno-txt { flex: 1; min-width: 0; }
.qfloat__hint { font-size: .72rem; color: #969899; margin: 9px 0 0; line-height: 1.45; }
.qfloat__help {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    background: #25D366;
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s;
}
.qfloat__help:hover { background: #1ebe57; }
.qfloat__help .icon { width: 1.1em; height: 1.1em; fill: currentColor; }
.qfloat.is-q5 .qfloat__bar { background: #1f9d63; }
.qfloat.is-q4 .qfloat__bar { background: #4caf6e; }
.qfloat.is-q3 .qfloat__bar { background: #DA6438; }
.qfloat.is-q2 .qfloat__bar { background: #e08a3c; }
.qfloat.is-q1 .qfloat__bar { background: #d9534f; }
.qfloat.is-q0 .qfloat__bar { background: #CC0000; }
.qfloat.is-q5 .qfloat__quality strong { color: #1f9d63; }
.qfloat.is-q4 .qfloat__quality strong { color: #1f9d63; }
.qfloat.is-q3 .qfloat__quality strong { color: #DA6438; }
.qfloat.is-q2 .qfloat__quality strong { color: #c0721f; }
.qfloat.is-q1 .qfloat__quality strong { color: #CC0000; }
.qfloat.is-q0 .qfloat__quality strong { color: #CC0000; }

/* Wrappers do qfloat: block no desktop, flex no mobile (via media query) */
.qfloat__info    { display: block; }
.qfloat__bar-row { display: block; }

/* Ações do qfloat — visíveis em todos os tamanhos */
.qfloat__actions { display: flex; gap: 8px; margin-top: 4px; }

/* Botão base */
.qf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 8px !important;
    font-size: .84rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background .15s;
    text-decoration: none;
}
.qf-btn:not(.btn-gray) { background: #DA6438; color: #fff; }
.qf-btn:not(.btn-gray):hover { background: #c0532a; }
.qf-btn:disabled { background: #dcdcdc !important; color: #8a8c8d !important; cursor: not-allowed; }
.qf-btn .fa-tokens { font-size: .72rem; font-weight: 400; }

/* Proporções desktop: salvar só o ícone | publicar ocupa o resto */
.qf-btn--save    { flex: 0 0 auto; padding: 5px 15px; }
.qf-btn--publish { flex: 1; padding: 5px 15px; }
.qf-btn--help    { display: none; }

/* Em telas largas: fixa flutuando na lateral direita, sem cobrir o formulário. */
@media (min-width: 1280px) {
    #promocao-form { margin-right: 260px; }
    #promocao-form .qfloat {
        position: fixed;
        right: 24px;
        top: 86px;
        width: 224px;
        margin-bottom: 0;
        z-index: 90;
    }
}

/* Botões pequenos para ações em tabela (Editar / Publicar / Dar tokens) */
.btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: auto;
    padding: 4px 10px;
    font-size: .78rem;
    border-radius: 6px;
    text-decoration: none;
    vertical-align: middle;
    margin: 1px 2px;
}
.btn-sm .icon { width: .9em; }

/* Botão ícone-only (quadrado, sem label) */
.btn-icon { padding: 5px 7px; gap: 0; }
.btn-icon .icon { width: 1em; height: 1em; }

/* Tabela de promoções do parceiro */
.promo-table .pt-img { width: 56px; padding: 6px 8px; }
.promo-table .pt-acts { width: 1%; white-space: nowrap; }
.promo-acts { display: flex; gap: 3px; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
.promo-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; display: block; }
.promo-thumb--empty { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; background: #f1efed; border-radius: 8px; color: #c0bbb6; }
.promo-thumb--empty .icon { width: 1.4em; height: 1.4em; }

/* Chip de tokens no topo do painel da Empresa */
.topbar__tokens {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 99px;
    background: #fdf1ea;
    color: #97431f;
    font-size: .82rem;
    text-decoration: none;
    transition: background .15s;
}
.topbar__tokens:hover { background: #fbe4d6; }
.topbar__tokens .icon { width: 1em; }

.topbar__buy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 99px;
    background: #DA6438;
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s;
}
.topbar__buy:hover { background: #c0532a; }
.topbar__buy .icon { width: .9em; }
.topbar__buy-coin { display: inline-flex; align-items: center; }  /* + junto da moeda */

/* ── Carrinho de compras (widget do topo) ──────────────────── */
.cartw { position: relative; display: inline-block; }
.cartw__btn {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center;
    gap: 4px; padding: 5px 9px; border-radius: 99px; color: #333; font-size: 1rem; position: relative;
}
.cartw__btn::-webkit-details-marker { display: none; }
.cartw__btn:hover { background: #f1efed; }
.cartw__btn .icon { width: 1.05em; }
.cartw__badge {
    position: absolute; top: -2px; right: -3px; min-width: 17px; height: 17px;
    padding: 0 4px; border-radius: 99px; background: #DA6438; color: #fff;
    font-size: .66rem; font-weight: 800; line-height: 17px; text-align: center;
}
.cartw__panel {
    position: absolute; right: 0; top: calc(100% + 8px); width: 290px; z-index: 120;
    background: var(--bg-card); border: 1px solid #e6e3e0; border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,.16); padding: 14px; cursor: default;
}
.cartw__title { font-weight: 800; font-size: .92rem; margin-bottom: 10px; color: #333; }
.cartw__empty { color: #969899; font-size: .82rem; margin: 0; line-height: 1.5; }
.cartw__line { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid #eeeeee; }
.cartw__line:first-of-type { border-top: none; }
.cartw__info { flex: 1; min-width: 0; line-height: 1.25; }
.cartw__info strong { display: block; font-size: .82rem; color: #333; }
.cartw__info span { color: #969899; font-size: .72rem; }
.cartw__qty { display: inline-flex; align-items: center; gap: 2px; }
.cartw__step {
    width: 24px; height: 24px; border: 1px solid #dcdcdc; background: #f1efed;
    border-radius: 6px; cursor: pointer; color: #333; display: inline-flex;
    align-items: center; justify-content: center; padding: 0;
}
.cartw__step .icon { width: .7em; }
.cartw__step:hover { border-color: #DA6438; color: #DA6438; }
.cartw__num { min-width: 18px; text-align: center; font-weight: 700; font-size: .82rem; color: #333; }
.cartw__rm button {
    width: 24px; height: 24px; border: none; background: none; cursor: pointer;
    color: #969899; display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.cartw__rm button .icon { width: .8em; }
.cartw__rm button:hover { color: #CC0000; }
.cartw__totals {
    display: flex; align-items: center; justify-content: space-between;
    margin: 10px 0; padding-top: 10px; border-top: 1px solid #eeeeee; font-size: .88rem; color: #333;
}
.cartw__totals strong { color: #DA6438; font-size: 1rem; }
.cartw__checkout {
    width: 100%; border: none; background: #DA6438; color: #fff; font-weight: 700;
    padding: 9px; border-radius: 8px; cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center; gap: 6px; font-size: .9rem;
}
.cartw__checkout .icon { width: .95em; }
.cartw__checkout:hover { background: #c0532a; }

/* ── Tabela de Empresas (admin) ────────────────────────────── */
.emp-table { table-layout: fixed; width: 100%; border-collapse: collapse; }
/* As linhas usam .loc-trow (para a busca), que nas loc-table é display:flex.
   Aqui forçamos o comportamento normal de tabela. */
.emp-table thead tr,
.emp-table tbody tr.loc-trow { display: table-row; }
.emp-table th,
.emp-table td {
    display: table-cell;        /* anula display:flex herdado de classes col-* das loc-table */
    padding: 11px 12px;
    vertical-align: middle;
    border-bottom: 1px solid #ededed;
}
.emp-table thead th {
    font-size: .7rem;
    font-weight: 700;
    color: #969899;
    text-transform: uppercase;
    letter-spacing: .5px;
    text-align: center;
}
.emp-table thead th.c-emp { text-align: left; }
.emp-table tbody tr:hover { background: #faf7f5; }
.emp-table tbody tr:last-child td { border-bottom: none; }

/* Larguras: Empresa ocupa o resto, as demais fixas */
.emp-table .c-emp    { width: auto;  text-align: left; }
.emp-table .c-status { width: 124px; text-align: center; }
.emp-table .c-trust  { width: 92px;  text-align: center; }
.emp-table .c-saldo  { width: 96px;  text-align: center; }
.emp-table .c-grant  { width: 132px; text-align: center; }
.emp-table .c-acts   { width: 200px; text-align: center; white-space: nowrap; }
.ustatus { font-size: .78rem; font-weight: 600; }
.ustatus.is-on  { color: #1f9d63; }
.ustatus.is-off { color: #c0392b; }
.ucard__toggle { margin-top: 16px; }
.ucard__toggle .btn-block { width: 100%; }

/* Coluna Empresa */
.emp-name { font-size: .9rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-name strong { color: #2b2b2b; }
.emp-name small  { color: #969899; font-weight: 400; }
.emp-meta { font-size: .74rem; color: #969899; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cup-gift { color: #DA6438; cursor: help; margin-right: 3px; }
.cup-gift .icon { width: 13px; height: 13px; vertical-align: -2px; }

/* Cadastro de empresa em etapas */
.reg-wizard { max-width: 480px; margin: 0 auto; }
.reg-steps { margin-bottom: 18px; }
.reg-steps__bar { height: 6px; background: #ece3da; border-radius: 99px; overflow: hidden; }
.reg-steps__fill { height: 100%; background: var(--laranja, #DA6438); border-radius: 99px; transition: width .3s; }
.reg-steps__items { display: flex; justify-content: space-between; margin-top: 8px; font-size: .82rem; color: #969899; }
.reg-step { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.reg-step__n { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: #ece3da; color: #969899; font-size: .72rem; }
.reg-step.is-active { color: var(--laranja, #DA6438); }
.reg-step.is-active .reg-step__n { background: var(--laranja, #DA6438); color: #fff; }
.reg-step.is-done { color: #007500; }
.reg-step.is-done .reg-step__n { background: #007500; color: #fff; }
.reg-tabs { display: flex; gap: 8px; margin: 16px 0 12px; }
.reg-tab { flex: 1; padding: 9px 10px; border: 1px solid #e7ddd3; border-radius: 10px; background: #faf6f1; color: #6a6a6a; font-weight: 600; cursor: pointer; font-family: inherit; }
.reg-tab.is-active { background: var(--laranja, #DA6438); color: #fff; border-color: var(--laranja, #DA6438); }
.reg-pane[hidden] { display: none !important; }
.nasc-campos { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 8px; }
.nasc-campos select { width: 100%; }
.cep-msg { display: block; color: #c0392b; font-size: .82rem; margin: 4px 0 8px; }

/* Status */
.emp-table select[name="status"] { width: 100%; padding: 5px 8px; font-size: .8rem; }

/* Confiável */
.emp-table .c-trust input { width: 17px; height: 17px; accent-color: #DA6438; cursor: pointer; }

/* Saldo */
.saldo-num { font-weight: 700; color: #2b2b2b; font-size: .9rem; }

/* Conceder tokens */
.emp-table .grant { display: inline-flex; align-items: center; gap: 5px; }
.emp-table .grant input[type="number"] {
    width: 56px;
    padding: 5px 6px;
    font-size: .8rem;
    text-align: center;
}

/* Toggle de ativo/inativo (coluna Ativo dos usuários) */
.emp-table .btn-toggle {
    background: none;
    border: none;
    padding: 2px;
    margin: 0;
    cursor: pointer;
    line-height: 0;
}
.emp-table .btn-toggle .icon { width: 1.9em; height: auto; }
.emp-table .btn-toggle.on  { color: #007500; }
.emp-table .btn-toggle.off { color: #b8babb; }
.emp-table .btn-toggle:hover { opacity: .8; }
/* Linha de cliente inativo fica esmaecida */
.emp-table tr.is-inactive .emp-name strong,
.emp-table tr.is-inactive .saldo-num { color: #969899; }
.emp-table tr.is-inactive { background: #fbfbfb; }

/* ===== Suporte / Chamados ===== */
.back-link {
    display: inline-block;
    margin-bottom: 12px;
    color: #969899;
    text-decoration: none;
    font-size: .9rem;
}
.back-link:hover { color: #333; }

/* Badge de status do chamado */
.tstatus {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
    white-space: nowrap;
}
.tstatus--aberto    { background: #fdeee8; color: #DA6438; }
.tstatus--andamento { background: #fff6e0; color: #9a6b00; }
.tstatus--concluido { background: #e6f4e6; color: #007500; }

/* Lista de chamados */
.ticket-list { display: flex; flex-direction: column; gap: 8px; }
.ticket-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #eee;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    box-shadow: var(--sombra);
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.ticket-row:hover { border-color: #DA6438; background: #fffaf8; box-shadow: var(--sombra-hover); }
.ticket-row strong { display: block; font-size: .95rem; }

/* Janela do chat */
.chat {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 460px;
    overflow-y: auto;
    padding: 14px 4px;
    margin: 8px 0 14px;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}
.chat__msg { display: flex; }
.chat__msg--me    { justify-content: flex-end; }
.chat__msg--admin { justify-content: flex-start; }
.chat__bubble {
    max-width: 78%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: .92rem;
    line-height: 1.4;
}
.chat__msg--me .chat__bubble    { background: #DA6438; color: #fff; border-bottom-right-radius: 4px; }
.chat__msg--admin .chat__bubble { background: #f1f1f2; color: #333; border-bottom-left-radius: 4px; }
.chat__who  { font-size: .7rem; font-weight: 700; opacity: .85; margin-bottom: 2px; }
.chat__text { word-break: break-word; }
.chat__time { font-size: .68rem; opacity: .7; margin-top: 4px; text-align: right; }

/* Campo de resposta do chat */
.chat__reply textarea { width: 100%; box-sizing: border-box; }
.chat__actions { display: flex; gap: 10px; margin-top: 8px; }
.chat__actions button { flex: 0 0 auto; }

/* Badge de contagem no menu (chamados pendentes) */
.nav-badge {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    margin-left: 6px;
    border-radius: 999px;
    background: #DA6438;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.5;
}

/* Abas de filtro de chamados (admin) */
.chamados-filtro { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filtro-tab {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #eee;
    background: #fff;
    color: #969899;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
}
.filtro-tab:hover { border-color: #DA6438; color: #333; }
.filtro-tab.active { background: #DA6438; border-color: #DA6438; color: #fff; }

/* Botões de ícone (conceder / salvar / excluir) */
.emp-table .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 7px;
    font-size: .9rem;
}
.emp-table .c-acts .btn-icon + .btn-icon { margin-left: 4px; }

/* ── Formulário de promoção: linhas dinâmicas e blocos ─────── */
.horario-row, .reg-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.horario-row input[type="time"] { width: auto; flex: 0 0 auto; }

/* Widget de horário de funcionamento da loja */
.loja-horarios .lh-dias { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.loja-horarios .lh-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.loja-horarios input[type="time"] { width: auto; flex: 0 0 auto; }
.loja-horarios .lh-rm { padding: 2px 9px; line-height: 1; }
.loja-horarios .lh-dia { margin: 8px 0; padding: 8px 10px; border: 1px solid #e7ddd3; border-radius: 8px; }
.loja-horarios .lh-dia > strong { display: block; margin-bottom: 6px; }
.loja-horarios .lh-add-dia { margin-top: 4px; }
/* Mapa do pino manual da loja */
.loja-map { height: 260px; width: 100%; border: 1px solid #e7ddd3; border-radius: 12px; overflow: hidden; margin-bottom: 8px; background: #eef1f3; z-index: 0; }
.loja-map .leaflet-container { height: 100%; width: 100%; }
.reg-row input[type="text"] { flex: 1; }
.horario-rm, .reg-rm {
    flex: 0 0 auto;
    padding: 4px 10px !important;
    line-height: 1;
    font-size: 1rem;
}
/* Pedidos + cobrança Pix */
.order-row { border: 1px solid #ededed; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.order-row__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pix-pay { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-top: 12px; }
.pix-pay__qr { border: 1px solid #e1e1e1; border-radius: 10px; background: #fff; flex: 0 0 auto; }
.pix-pay__side { flex: 1 1 240px; min-width: 0; }
.pix-code {
    width: 100%;
    font-family: monospace;
    font-size: .8rem;
    padding: 8px 10px;
    border: 1.5px solid #dcdcdc;
    border-radius: 8px;
    resize: vertical;
    word-break: break-all;
}

/* Pacotes de tokens (compra) */
.pkg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin-top: 6px;
}
.pkg-card {
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    padding: 18px 16px;
    text-align: center;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--sombra);
}
.pkg-card__tokens { font-size: 1.5rem; font-weight: 800; color: #2b2b2b; line-height: 1; }
.pkg-card__tokens span { font-size: .8rem; font-weight: 600; color: #969899; }
.pkg-card__price { color: #007500; font-weight: 700; font-size: 1.05rem; }
.pkg-card button { margin-top: 4px; width: 100%; justify-content: center; }

/* Validar cupom (admin) — prefixo SHU- fixo + código */
.validar-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.code-input { display: flex; flex: 1 1 260px; min-width: 0; }
.code-prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 10px 0 14px;
    background: #f1efed;
    border: 1.5px solid #dcdcdc;
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-weight: 800;
    color: #555;
    font-size: 1.05rem;
    letter-spacing: 1px;
}
.validar-form input[type="text"] {
    flex: 1;
    min-width: 0;
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 10px 12px;
    border-radius: 0 8px 8px 0;
}
.validar-form button { flex: 0 0 auto; }
.validar-form button .icon { width: .95em; }
.validar-form input.code-ok { border-color: #007500; box-shadow: 0 0 0 3px rgba(0,117,0,.12); }

.seg-radio { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-radio .check-line { margin: 0; }
.info-box {
    background: #fdf1ea;
    border: 1px solid #f3d9c9;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: .8rem;
    color: #8a4326;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* ============================================================
   Tutorial de boas-vindas (painel da empresa) — page=bemvindo
   ============================================================ */
.welcome { max-width: 960px; margin: 0 auto; }

.welcome-hero {
    text-align: center;
    padding: 34px 28px;
    margin-bottom: 26px;
    background: linear-gradient(135deg, #fff 0%, #fbeee6 100%);
    border: 1px solid #f0e0d4;
}
.welcome-hero__title { font-size: 1.7rem; color: #2b2b2b; margin: 0 0 12px; letter-spacing: -.4px; }
.welcome-hero__title .icon { width: 1.1em; height: 1.1em; color: #DA6438; vertical-align: -.15em; }
.welcome-hero__lead { font-size: 1rem; color: #555; line-height: 1.6; max-width: 680px; margin: 0 auto; }
.welcome-hero__lead strong { color: #2b2b2b; }

.welcome-section { margin-bottom: 30px; }
.welcome-h2 {
    display: flex; align-items: center; gap: 9px;
    font-size: 1.15rem; color: #2b2b2b; margin: 0 0 16px;
}
.welcome-h2 .icon { width: 1em; height: 1em; color: #DA6438; }

/* Fluxo de 4 passos */
.welcome-flow { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.welcome-flow__step {
    flex: 1 1 180px;
    position: relative;
    background: var(--bg-card);
    border: 1px solid #ece6df;
    border-radius: 14px;
    padding: 20px 16px 16px;
    box-shadow: var(--sombra);
    text-align: center;
}
.welcome-flow__num {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    width: 26px; height: 26px; border-radius: 50%;
    background: #DA6438; color: #fff; font-weight: 800; font-size: .85rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(218,100,56,.4);
}
.welcome-flow__icon { display: block; font-size: 1.7rem; color: #DA6438; margin: 4px 0 10px; }
.welcome-flow__icon .icon { width: 1em; height: 1em; }
.welcome-flow__step h3 { font-size: .95rem; color: #2b2b2b; margin: 0 0 6px; }
.welcome-flow__step p { font-size: .82rem; color: #777; line-height: 1.45; margin: 0; }
.welcome-flow__arrow { display: flex; align-items: center; color: #d9c4b5; flex: 0 0 auto; }
.welcome-flow__arrow .icon { width: 1.3em; height: 1.3em; }

/* Cards explicativos */
.welcome-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.welcome-card { padding: 20px 20px 18px; }
.welcome-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.welcome-card__head h3 { font-size: 1rem; color: #2b2b2b; margin: 0; }
.welcome-card__ic {
    flex: 0 0 auto;
    width: 40px; height: 40px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.05rem;
}
.welcome-card__ic .icon { width: 1em; height: 1em; }
.welcome-card__ic.ic-coins  { background: linear-gradient(135deg, #DA6438 0%, #e88a62 100%); }
.welcome-card__ic.ic-orange { background: linear-gradient(135deg, #e0822f 0%, #f0a85a 100%); }
.welcome-card__ic.ic-purple { background: linear-gradient(135deg, #b5742e 0%, #e0a45a 100%); }
.welcome-card__ic.ic-teal   { background: linear-gradient(135deg, #1f9d63 0%, #5fd98a 100%); }
.welcome-card__ic.ic-navy   { background: linear-gradient(135deg, #3d3a37 0%, #5b554f 100%); }
.welcome-card__ic.ic-gray   { background: linear-gradient(135deg, #7a7a7a 0%, #a0a0a0 100%); }
.welcome-card__ic.ic-green  { background: linear-gradient(135deg, #1f9d63 0%, #5fd98a 100%); }
.welcome-card--highlight { border: 1px solid #cfe9d8; background: linear-gradient(135deg, #fff 0%, #eaf6ee 100%); }
.welcome-card p { font-size: .86rem; color: #666; line-height: 1.5; margin: 0 0 8px; }
.welcome-card p:last-child { margin-bottom: 0; }
.welcome-card strong { color: #2b2b2b; }
.welcome-card__tip {
    background: #f7f4f1; border-radius: 8px; padding: 8px 11px;
    font-size: .8rem !important; color: #6a6a6a !important;
}
.welcome-card__tip .icon { width: 1em; height: 1em; color: #DA6438; vertical-align: -.15em; margin-right: 3px; }
.welcome-card__tip strong { color: #DA6438; }

/* Lista de primeiros passos */
.welcome-steps { margin: 0; padding: 0; list-style: none; counter-reset: ws; }
.welcome-steps li {
    position: relative;
    padding: 12px 14px 12px 46px;
    margin-bottom: 8px;
    background: var(--bg-card);
    border: 1px solid #ece6df;
    border-radius: 10px;
    font-size: .9rem; color: #555; line-height: 1.45;
    box-shadow: var(--sombra);
}
.welcome-steps li::before {
    counter-increment: ws; content: counter(ws);
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 24px; height: 24px; border-radius: 50%;
    background: #2b2b2b; color: #fff; font-weight: 700; font-size: .8rem;
    display: flex; align-items: center; justify-content: center;
}
.welcome-steps strong { color: #2b2b2b; }
.welcome-steps em { color: #DA6438; font-style: normal; font-weight: 600; }

/* Barra de ações final */
.welcome-actions {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 14px;
    position: sticky; bottom: 0;
    margin-top: 26px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e6e3e0;
    border-radius: 14px;
    box-shadow: 0 -4px 18px rgba(0,0,0,.06);
}
.welcome-actions__check { margin: 0 !important; font-size: .88rem; color: #555; }
.welcome-actions__btn { flex: 0 0 auto; }
.btn-cta.welcome-actions__btn { display: inline-flex; align-items: center; gap: 8px; }

@media (max-width: 760px) {
    .welcome-grid { grid-template-columns: 1fr; }
    .welcome-flow__arrow { display: none; }
    .welcome-flow__step { flex-basis: calc(50% - 3px); }
    .welcome-hero__title { font-size: 1.4rem; }
    .welcome-actions { flex-direction: column; align-items: stretch; }
    .welcome-actions__btn { width: 100%; justify-content: center; }
}

/* ============================================================
   Dashboard do parceiro — cards financeiros, funil, barras, stats
   ============================================================ */
.dash-section-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 1.05rem; color: #2b2b2b; margin: 26px 0 14px;
}
.dash-section-title .icon { width: 1em; height: 1em; color: #DA6438; }

/* Cards financeiros (R$) */
.fin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 14px;
}
.fin-grid--3 { grid-template-columns: repeat(3, 1fr); }

/* Selo "voltou" — cliente antigo reconhecido (legacy_claims) */
.legacy-tag {
    display: inline-flex; align-items: center; gap: 4px;
    margin-left: 6px; padding: 1px 8px; border-radius: 99px;
    background: rgba(218,100,56,.12); color: #DA6438;
    font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
    vertical-align: middle;
}
.legacy-tag .icon { width: .8em; height: .8em; }

/* Filtro da tabela de usuários: busca + "só antigos" */
.users-filter { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.users-filter .table-search { flex: 1 1 240px; }
.chk-antigos {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    padding: 7px 12px; border-radius: 10px; border: 1px solid #dcdcdc;
    background: #fff; font-size: .85rem; color: #333; white-space: nowrap;
}
.chk-antigos .icon { width: 1em; height: 1em; color: #DA6438; }
.chk-antigos input { accent-color: #DA6438; }
.fin-card {
    background: var(--bg-card);
    border: 1px solid #ece6df;
    border-left: 4px solid #969899;
    border-radius: 13px;
    padding: 15px 16px;
    box-shadow: var(--sombra);
}
.fin-card__top { display: flex; align-items: center; gap: 7px; font-size: .76rem; color: #777; font-weight: 600; }
.fin-card__ic {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
    background: #f1efed; color: #969899;
}
.fin-card__ic .icon { width: .95em; height: .95em; }
.fin-card__value { font-size: 1.45rem; font-weight: 800; color: #2b2b2b; line-height: 1.15; margin-top: 8px; letter-spacing: -.5px; }
.fin-card__value small { font-size: .62em; font-weight: 700; color: #969899; }
.fin-card__sub { font-size: .72rem; color: #969899; margin-top: 2px; }
.fin-card--in   { border-left-color: #c79a3a; } .fin-card--in   .fin-card__ic { background: #f7efda; color: #b07e1e; }
.fin-card--out  { border-left-color: #DA6438; } .fin-card--out  .fin-card__ic { background: #fdeee6; color: #c0532a; }
.fin-card--back { border-left-color: #1f9d63; } .fin-card--back .fin-card__ic { background: #e7f6ee; color: #1f9d63; }
.fin-card--back .fin-card__value { color: #176638; }
.fin-card--net  { border-left-color: #3d3a37; } .fin-card--net  .fin-card__ic { background: #ecebe9; color: #3d3a37; }
.fin-card--avg  { border-left-color: #9b59b6; } .fin-card--avg  .fin-card__ic { background: #f2e9f6; color: #8e44ad; }
.fin-card--bal  { border-left-color: #2c6fbb; } .fin-card--bal  .fin-card__ic { background: #e6eff8; color: #2c6fbb; }

/* Funil de conversão */
.funnel { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.funnel__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.funnel__label { font-size: .82rem; color: #555; font-weight: 600; }
.funnel__num { font-size: .95rem; font-weight: 800; color: #2b2b2b; }
.funnel__num small { font-size: .7rem; font-weight: 700; color: #1f9d63; margin-left: 4px; }
.funnel__track { height: 12px; background: #f1efed; border-radius: 99px; overflow: hidden; }
.funnel__bar { height: 100%; border-radius: 99px; transition: width .5s ease; min-width: 6px; }

/* Donut em linha (gráfico + legenda lado a lado) */
.donut-wrap--row { flex-direction: row; align-items: center; justify-content: flex-start; gap: 22px; }
.donut-wrap--row .donut { width: 130px; height: 130px; }
.donut-wrap--row .donut__hole { width: 78px; height: 78px; }
.donut-wrap--row .donut__hole-value { font-size: 1.15rem; }
.donut-wrap--row .donut-legend { flex: 1; }

/* Gráfico de barras (atividade) */
.barchart {
    display: flex; align-items: flex-end; gap: 6px;
    height: 150px; padding-top: 18px; margin-top: 4px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;  /* muitos dias: rola dentro do card */
}
.barchart__col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; min-width: 0; }
.barchart__val { font-size: .68rem; font-weight: 700; color: #555; margin-bottom: 3px; height: 14px; }
.barchart__bar {
    width: 100%; max-width: 30px;
    background: linear-gradient(180deg, #e88a62 0%, #DA6438 100%);
    border-radius: 6px 6px 0 0; min-height: 0;
    transition: height .5s ease;
}
.barchart__lbl { font-size: .62rem; color: #969899; margin-top: 6px; white-space: nowrap; transform: rotate(-30deg); transform-origin: center; }

/* Stat cards coloridos (resumo do negócio) */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat-card {
    position: relative; overflow: hidden;
    border-radius: 13px; padding: 16px 18px; color: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,.10);
}
.stat-card__ic { position: absolute; right: 12px; top: 12px; opacity: .35; font-size: 1.6rem; }
.stat-card__ic .icon { width: 1em; height: 1em; }
.stat-card__value { font-size: 1.8rem; font-weight: 800; line-height: 1; letter-spacing: -.5px; }
.stat-card__label { font-size: .78rem; opacity: .9; margin-top: 5px; }
.stat-card--teal   { background: linear-gradient(135deg, #1f9d63 0%, #5fd98a 100%); }
.stat-card--orange { background: linear-gradient(135deg, #DA6438 0%, #e88a62 100%); }
.stat-card--purple { background: linear-gradient(135deg, #8e44ad 0%, #b06fc9 100%); }
.stat-card--gold   { background: linear-gradient(135deg, #c79a3a 0%, #e8c878 100%); }
.stat-card--blue   { background: linear-gradient(135deg, #2c6fbb 0%, #5b9bdf 100%); }
.stat-card--green  { background: linear-gradient(135deg, #2ea36b 0%, #6cc79a 100%); }
.stat-card--navy   { background: linear-gradient(135deg, #3d3a37 0%, #5b554f 100%); }

/* Barras de receita (verde = dinheiro) */
.barchart--rev .barchart__bar { background: linear-gradient(180deg, #5fd98a 0%, #1f9d63 100%); }

/* ============================================================
   Consumir cupom (parceiro) — desktop só digita; mobile abre a câmera
   ============================================================ */
.consume-scan { display: none; }   /* desktop: apenas a digitação */

.consume-scan__cam {
    position: relative;
    width: 100%;
    height: 60vh; min-height: 300px;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
}
.consume-scan__cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.consume-scan__frame {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: min(64vw, 250px); height: min(64vw, 250px);
    border: 3px solid rgba(255,255,255,.92);
    border-radius: 20px;
    box-shadow: 0 0 0 100vmax rgba(0,0,0,.4);
    pointer-events: none;
}
.consume-scan__status {
    position: absolute; left: 12px; right: 12px; bottom: 14px;
    text-align: center; color: #fff; font-size: .85rem; font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,.7);
}
.consume-scan__bar { padding: 16px 0 4px; display: flex; justify-content: center; }
.consume-scan__hint { text-align: center; color: #969899; font-size: .82rem; margin: 0 0 12px; }
.consume-scan__bar .btn-dark { padding: 14px 18px; font-size: 1rem; }

.consume-switch {
    display: inline-flex; align-items: center; gap: 7px;
    margin-top: 14px; color: #DA6438; font-weight: 600; font-size: .9rem;
}
.consume-switch .icon { width: 1em; height: 1em; }

/* Bottom-sheet de confirmação de baixa (Consumir cupom) */
.pctoast { display: none; margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-weight: 600; }
.pctoast.err { display: block; background: #fdecea; color: #b93a2b; border: 1px solid #f3c6bf; }
.pctoast.ok  { display: block; background: #eaf7f0; color: #1f7d52; border: 1px solid #b9e6cd; }
.pcsheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 200; }
.pcsheet-bg.open { opacity: 1; pointer-events: auto; }
.pcsheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 210; background: #fff; color: #222;
    border-radius: 20px 20px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
    transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.7,.2,1);
    max-height: 78vh; overflow: auto; box-shadow: 0 -8px 30px rgba(0,0,0,.28); max-width: 560px; margin: 0 auto; }
.pcsheet.open { transform: translateY(0); }
.pcsheet__grip { width: 44px; height: 5px; border-radius: 99px; background: #dcdcdc; margin: 0 auto 14px; }
.pcsheet__tag { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; padding: 5px 10px; border-radius: 99px; background: #eef7f1; color: #1f9d63; }
.pcsheet__tag.err { background: #fdecea; color: #c0392b; }
.pcsheet__tag .icon { width: 1em; height: 1em; }
.pcsheet h2 { margin: 12px 0 6px; font-size: 1.25rem; }
.pcsheet__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid #eee; }
.pcsheet__row > span { color: #7a7a7a; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.pcsheet__row > span .icon { width: 1em; height: 1em; color: #969899; }
.pcsheet__row strong { font-size: 1.02rem; text-align: right; }
.pcsheet__price { font-size: 1.35rem; color: #DA6438; }
.pcsheet__wa { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; width: 100%; padding: 12px; border-radius: 12px; background: #25d366; color: #fff; font-weight: 700; text-decoration: none; }
.pcsheet__wa .icon { width: 1.1em; height: 1.1em; }
.pcsheet__acts { display: flex; gap: 10px; margin-top: 16px; }
.pcsheet__acts .icon { width: 1em; height: 1em; }

/* Botão de WhatsApp na lista de clientes */
.cli-wa { background: #25d366; color: #fff; }
.cli-wa:hover { background: #1fb457; color: #fff; }

/* Tabelas com colunas numéricas alinhadas à direita (1ª coluna fica à esquerda) */
.emp-table.tbl-num th:not(:first-child), .emp-table.tbl-num td:not(:first-child) { text-align: right; }

/* Relatórios da empresa — barras */
.rep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .rep-grid { grid-template-columns: 1fr; } }
.rep-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.rep-row__lbl { flex: 0 0 84px; width: 84px; font-size: .85rem; color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-row__track { flex: 1; background: #f1efed; border-radius: 99px; height: 16px; overflow: hidden; }
.rep-row__fill { height: 100%; background: #DA6438; border-radius: 99px; min-width: 2px; }
.rep-row__val { flex: 0 0 auto; font-size: .8rem; color: #444; min-width: 118px; text-align: right; }
.rep-hl { background: #fff6f1; border: 1px solid #f3d9ca; border-radius: 10px; padding: 10px 12px; color: #c0532a; font-weight: 600; margin: 2px 0 12px; }
.rep-hl .icon { width: 1em; height: 1em; }

@media (max-width: 768px) {
    /* Modo automático (sem v=digitar): esconde a digitação e mostra a câmera */
    .consume[data-view="auto"] .consume-type { display: none; }
    .consume[data-view="auto"] .consume-scan { display: flex; flex-direction: column; }
}

/* Extrato de tokens — chip da promoção de origem */
.ext-promo { display: inline-flex; align-items: center; gap: 5px; font-size: .84rem; color: #555; }
.ext-promo .icon { width: .9em; height: .9em; color: #DA6438; flex-shrink: 0; }

/* Dados da empresa (parceiro) — grade de leitura */
.empresa-dados {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px;
    margin-top: 6px;
}
.empresa-dados__item {
    background: #faf8f6; border: 1px solid #ece6df; border-radius: 10px; padding: 11px 14px;
}
.empresa-dados__lbl {
    display: block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #969899;
}
.empresa-dados__val { display: block; margin-top: 3px; font-size: .92rem; color: #2b2b2b; font-weight: 600; }

/* Upload da logo da empresa (formato 1:1) */
.logo-upload { display: flex; align-items: center; gap: 16px; margin: 4px 0 6px; flex-wrap: wrap; }
.logo-upload__preview {
    flex: 0 0 auto; width: 96px; height: 96px; border-radius: 14px;
    border: 1px dashed #d9cdc2; background:
        linear-gradient(45deg, #f3eee9 25%, transparent 25%) -8px 0/16px 16px,
        linear-gradient(-45deg, #f3eee9 25%, transparent 25%) -8px 0/16px 16px,
        linear-gradient(45deg, transparent 75%, #f3eee9 75%) -8px 0/16px 16px,
        linear-gradient(-45deg, transparent 75%, #f3eee9 75%) -8px 0/16px 16px,
        #faf8f6;
    overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.logo-upload__preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-upload__ph .icon { width: 34px; height: 34px; color: #c9bcae; }
.logo-upload__field { flex: 1 1 220px; min-width: 200px; }
.logo-upload__field input[type="file"] { margin-bottom: 6px; }

/* ============================================================
   Objetivos (gamificação) — admin
   ============================================================ */
.obj-modo { width: auto; padding: 6px 10px; font-size: .82rem; }

.obj-vigente {
    background: linear-gradient(135deg, #fff 0%, #fbeee6 100%);
    border: 1px solid #f0e0d4; border-radius: 12px; padding: 14px 16px;
}
.obj-vigente__titulo { font-size: 1.05rem; font-weight: 800; color: #2b2b2b; }
.obj-vigente__desc { font-size: .85rem; color: #777; margin-top: 3px; line-height: 1.4; }
.obj-vigente__tokens { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .9rem; color: #c0532a; }
.obj-vigente__tokens .icon { width: 1em; height: 1em; color: #DA6438; }
.obj-vigente__tokens strong { color: #2b2b2b; font-size: 1.05rem; }

.obj-list { display: flex; flex-direction: column; gap: 10px; }
.obj-item {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 14px; border: 1px solid #ece6df; border-radius: 12px;
    background: var(--bg-card); box-shadow: var(--sombra);
}
.obj-item.is-off { opacity: .62; }
.obj-item__main { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.obj-item__titulo { font-weight: 700; }
.obj-item__desc { font-size: .82rem; }
.obj-item__per { width: auto; flex: 0 0 auto; }
.obj-item__tk { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; color: #969899; font-size: .8rem; }
.obj-item__tk input { width: 84px; }
.obj-item__badges { display: inline-flex; gap: 5px; flex: 0 0 auto; }
.obj-item__acts { display: inline-flex; gap: 5px; flex: 0 0 auto; margin-left: auto; }
.obj-item__acts button { padding: 7px 11px; }

@media (max-width: 720px) {
    .obj-item__acts { margin-left: 0; }
    .obj-item__main { flex-basis: 100%; }
}

/* Painel de pendências (ações do admin) */
.pend-list { display: flex; flex-direction: column; gap: 8px; }
.pend-item {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 13px; border-radius: 10px;
    background: #fdf1ea; border: 1px solid #f3d9c9;
    color: #8a4326; font-size: .85rem; font-weight: 600;
    transition: background .15s, transform .1s;
}
.pend-item:hover { background: #fbe6d8; transform: translateX(2px); }
.pend-item__ic {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
    background: #DA6438; color: #fff;
}
.pend-item__ic .icon { width: .9em; height: .9em; }
.pend-item__txt { flex: 1; min-width: 0; }
.pend-item__badge {
    flex-shrink: 0; min-width: 24px; padding: 2px 8px;
    border-radius: 99px; background: #DA6438; color: #fff;
    font-size: .82rem; font-weight: 800; text-align: center;
}

@media (max-width: 600px) {
    .fin-grid  { grid-template-columns: repeat(2, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .donut-wrap--row { gap: 14px; }
    .donut-wrap--row .donut { width: 104px; height: 104px; }
    .donut-wrap--row .donut__hole { width: 62px; height: 62px; }
    .barchart__lbl { font-size: .55rem; }
}

/* ============================================================
   Ajustes mobile — tabelas/cards que estouravam a tela
   (admin e painel do parceiro compartilham este CSS)
   ============================================================ */
@media (max-width: 960px) {
    .fin-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    /* "diminuir os cards" para caber no celular — 2 colunas e tudo mais compacto */
    .fin-grid, .fin-grid--3, .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    /* permite o card encolher (evita "sangrar"/estourar a tela) */
    .fin-grid > *, .fin-grid--3 > *, .stat-grid > *, .kpi-grid > * { min-width: 0; }

    .fin-card { padding: 11px 12px; }
    .fin-card__top { font-size: .68rem; gap: 5px; }
    .fin-card__ic { width: 22px; height: 22px; }
    .fin-card__value { font-size: 1.05rem; margin-top: 5px; overflow-wrap: anywhere; }
    .fin-card__sub { font-size: .64rem; }

    .stat-card { padding: 12px 12px; }
    .stat-card__value { font-size: 1.25rem; overflow-wrap: anywhere; }
    .stat-card__label { font-size: .68rem; }
    .stat-card__ic { font-size: 1.15rem; right: 8px; top: 8px; }

    /* KPI cards (Tokens/Pagamentos/Convites) também compactos */
    .kpi-card { padding: 14px 14px; gap: 10px; }
    .kpi-card__icon { font-size: 1.5rem; }
    .kpi-card__value { font-size: 1.4rem; overflow-wrap: anywhere; }
    .kpi-card__label { font-size: .66rem; }
    .kpi-card__sub { font-size: .64rem; }

    /* Cards de gráfico: padding menor e barras roláveis (não vazam a tela) */
    .widget { padding: 16px 14px; }
    .widget__title { margin-bottom: 12px; padding-bottom: 9px; }
    .barchart { gap: 4px; }
    .barchart__col { min-width: 16px; }   /* com muitos dias, rola horizontal dentro do card */
    .donut-wrap--row { gap: 12px; }
}

@media (max-width: 380px) {
    /* telas bem pequenas: 1 coluna para não espremer */
    .fin-grid, .fin-grid--3, .stat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    /* Tabelas longas dos painéis rolam DENTRO do card (não empurram a página) */
    .card table:not(.emp-table),
    .promo-table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Tabela de usuários/empresas vira cartões empilhados — o NOME volta a aparecer */
    .emp-table { table-layout: auto; width: 100%; }
    .emp-table thead { display: none; }
    .emp-table tbody tr.loc-trow {
        display: flex; flex-wrap: wrap; align-items: center; gap: 8px 8px;
        border: 1px solid #ece6df; border-radius: 12px;
        padding: 12px 12px; margin-bottom: 10px; background: var(--bg-card);
    }
    .emp-table td { display: block; border: none !important; padding: 0; height: auto; }
    .emp-table .c-emp { flex: 1 1 100%; width: auto; text-align: left; }
    .emp-name, .emp-meta { white-space: normal; }   /* nome/meta podem quebrar e aparecer inteiros */
    .emp-table .c-status,
    .emp-table .c-trust,
    .emp-table .c-saldo,
    .emp-table .c-grant,
    .emp-table .c-acts { width: auto; flex: 0 0 auto; text-align: left; }
    .emp-table .c-saldo::before { content: "Saldo: "; color: #969899; font-size: .72rem; }
    /* Tabela de campanhas: cada célula mostra o seu próprio rótulo (não "Saldo:") */
    .emp-table--camp .c-saldo::before { content: none; }
    .emp-table--camp td[data-label]::before { content: attr(data-label) ": "; color: #969899; font-size: .72rem; }
    /* grupos inteiros não quebram no meio (sem botões em linhas separadas) */
    .emp-table .c-grant, .emp-table .grant { white-space: nowrap; }
    .emp-table .c-acts { margin-left: auto; white-space: nowrap; }
    /* botões mais compactos pra caber sem quebrar */
    .emp-table .btn-icon { width: 30px; height: 30px; }
    .emp-table .c-acts .btn-icon + .btn-icon { margin-left: 3px; }
    .emp-table .grant { gap: 4px; }
    .emp-table .grant input[type="number"] { width: 48px; padding: 5px 4px; }
    .emp-table tr.loc-trow + tr.loc-trow { /* espaçamento já no margin-bottom */ }
}

/* ============================================================
   Simulador de promoção (painel do parceiro)
   ============================================================ */
.sim-form__row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 6px; }
.sim-form__row > div { flex: 1 1 180px; }
.sim-form__row label { display: block; font-size: .82rem; color: #555; margin-bottom: 4px; }
.sim-form__row input { width: 100%; }
.sim-form__row button { flex: 0 0 auto; }

.sim-resumo { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-around; text-align: center; }
.sim-resumo__item { flex: 1 1 140px; }
.sim-resumo__lbl { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: #969899; }
.sim-resumo__val { display: block; font-size: 1.5rem; font-weight: 800; color: #DA6438; margin-top: 2px; }

.sim-card { position: relative; display: flex; flex-direction: column; overflow: visible; z-index: 1; }
.sim-card--rec { border: 2px solid #DA6438; box-shadow: 0 8px 26px -12px rgba(218,100,56,.45); z-index: 3; }
.sim-grid { align-items: start; }
.sim-card__flag { position: absolute; top: -11px; left: 16px; background: #DA6438; color: #fff; font-size: .7rem; font-weight: 800; padding: 3px 10px; border-radius: 99px; display: inline-flex; align-items: center; gap: 4px; }
.sim-card__flag .icon { width: .85em; height: .85em; }
.sim-card__nome { margin: 4px 0 2px; font-size: 1.15rem; color: #2b2b2b; }
.sim-card__tag { font-size: .8rem; color: #969899; margin: 0 0 12px; }
.sim-card__nota { background: #faf6f2; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.sim-card__nota span { display: block; font-size: .72rem; color: #969899; }
.sim-card__nota strong { font-size: 1rem; color: #DA6438; }

.sim-list { list-style: none; margin: 0; padding: 0; }
.sim-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #efe7e0; font-size: .86rem; }
.sim-list li:last-child { border-bottom: none; }
.sim-list li > span { color: #6f6660; display: inline-flex; align-items: center; gap: 6px; }
.sim-list li > span .icon { width: 1em; height: 1em; color: #DA6438; }
.sim-list li strong { text-align: right; color: #2b2b2b; }
.sim-list li strong small { color: #969899; font-weight: 600; }

.sim-card__fat { margin-top: auto; padding-top: 12px; }
.sim-card__fat > div:first-child { display: flex; justify-content: space-between; align-items: baseline; }
.sim-card__fat > div:first-child span { color: #6f6660; font-size: .86rem; }
.sim-card__fat > div:first-child strong { font-size: 1.2rem; color: #1f6d44; }
.sim-card__fat-sub { font-size: .72rem; color: #969899; margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.sim-card__fat-sub .icon { width: .9em; height: .9em; }

/* Tabela de cenários de projeção */
.sim-proj-wrap { overflow-x: auto; margin-top: 8px; }
.sim-proj { width: 100%; border-collapse: collapse; font-size: .86rem; }
.sim-proj th, .sim-proj td { padding: 9px 10px; text-align: left; border-bottom: 1px solid #efe7e0; white-space: nowrap; }
.sim-proj thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .4px; color: #969899; font-weight: 700; }
.sim-proj tbody tr.is-full { background: #f4faf6; }
.sim-proj tbody tr.is-full td:first-child strong { color: #1f6d44; }
.sim-proj td .icon { width: .95em; height: .95em; color: #DA6438; vertical-align: -2px; }
.sim-proj td small { color: #969899; }

/* Paginação das listagens */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid #eee; }
.pager__info { font-size: .82rem; color: #969899; }
.pager__nav { display: inline-flex; align-items: center; gap: 8px; }
.pager__page { font-size: .82rem; color: #555; }
.pager__btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px; border-radius: 8px; border: 1px solid #dcdcdc; background: #fff; color: #333; font-size: .84rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.pager__btn:hover { border-color: #DA6438; color: #DA6438; }
.pager__btn.is-disabled { opacity: .45; pointer-events: none; }
.pager__btn .icon { width: .8em; height: .8em; }

/* Modal de perfil do usuário */
.umodal { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.umodal[hidden] { display: none; }
.umodal__box { background: #fff; border-radius: 16px; max-width: 480px; width: 100%; max-height: 88vh; overflow-y: auto; padding: 22px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.umodal__close { position: absolute; top: 12px; right: 12px; border: 0; background: none; cursor: pointer; color: #969899; }
.umodal__close .icon { width: 18px; height: 18px; }
.ucard__head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ucard__nome { font-size: 1.1rem; font-weight: 800; color: #2b2b2b; }
.ucard__email { font-size: .85rem; color: #969899; margin-top: 2px; }
.ucard__email .icon { width: .9em; height: .9em; color: #1f9d63; }
.ucard__row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f0eae4; font-size: .88rem; }
.ucard__row:last-child { border-bottom: 0; }
.ucard__row > span { color: #969899; flex: none; }
.ucard__row > strong { color: #2b2b2b; text-align: right; }
.ucard__row .icon { width: 1em; height: 1em; vertical-align: -2px; color: #1f9d63; }
.ucard__row .legacy-tag { vertical-align: middle; }

/* Pills de status (Convites) */
.pill{display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border-radius:999px;font-size:12px;font-weight:600;line-height:1;white-space:nowrap}
.pill .icon{width:11px;height:11px}
.pill--ok{background:rgba(31,157,99,.14);color:#1f9d63}
.pill--wait{background:rgba(150,150,150,.16);color:#7a7a7a}

/* Barra superior de aviso (suporte respondeu) */
.topnote{overflow:hidden;max-height:0;transition:max-height .42s ease;background:linear-gradient(135deg,#1f9d63 0%,#46c489 100%);color:#fff;box-shadow:0 2px 10px rgba(0,0,0,.12)}
.topnote.is-open{max-height:140px}
.topnote__inner{max-width:1100px;margin:0 auto;padding:11px 18px;display:flex;align-items:center;gap:12px}
.topnote__txt{flex:1;font-size:14px;font-weight:600;line-height:1.3;display:flex;align-items:center;gap:8px}
.topnote__txt .icon{width:18px;height:18px;flex-shrink:0}
.topnote__btn{flex-shrink:0;background:#fff;color:#1f7d52;border:none;border-radius:8px;font-weight:700;font-size:14px;padding:8px 16px;cursor:pointer;text-decoration:none;white-space:nowrap;display:inline-flex;align-items:center;gap:6px}
.topnote__btn .icon{width:15px;height:15px}
.topnote__btn:hover{opacity:.92}
.topnote__close{flex-shrink:0;background:transparent;border:none;color:#fff;cursor:pointer;padding:4px;display:inline-flex;opacity:.85}
.topnote__close .icon{width:18px;height:18px}
.topnote__close:hover{opacity:1}
@media (max-width:560px){.topnote.is-open{max-height:160px}.topnote__txt{font-size:13px}.topnote__btn{padding:7px 12px;font-size:13px}}

/* Anexos em chamados de suporte */
.sup-anexo-label{display:inline-flex;align-items:center;gap:6px;margin-top:8px;font-size:13px;color:#555}
.sup-anexo-label .icon{width:14px;height:14px}
.sup-anexo-label small{color:#969899;font-weight:400}
.tanexo{display:inline-flex;align-items:center;gap:6px;margin-top:6px;padding:6px 10px;background:rgba(0,0,0,.07);border-radius:8px;font-size:13px;color:inherit;text-decoration:none;max-width:100%;word-break:break-all}
.tanexo .icon{width:15px;height:15px;flex-shrink:0}
.tanexo:hover{background:rgba(0,0,0,.13)}
.chat__msg--me .tanexo{background:rgba(255,255,255,.25)}

/* Ícone de plataforma de acesso (lista de usuários) */
.plat-ic{display:inline-flex;vertical-align:middle;margin-left:5px}
.plat-ic .icon{width:14px;height:14px}
.plat-ic--android{color:#3ddc84}
.plat-ic--ios{color:#555}
.plat-ic--web{color:#2c6fbb}

/* Grade de 2 colunas em formulários (config NFS-e) */
.form-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:0 16px}
.form-grid-2 > div{min-width:0}
.form-grid-2 input,.form-grid-2 select{width:100%}
@media (max-width:640px){.form-grid-2{grid-template-columns:1fr}}

/* Lojas dentro do modal de empresa (admin) */
.ucard__loja{border:1px solid #ece6df;border-radius:10px;padding:10px 12px;margin-bottom:8px}
.ucard__loja-nome{font-weight:700;color:#2b2b2b;font-size:.9rem}
.ucard__loja-end,.ucard__loja-tel{font-size:.8rem;color:#666;margin-top:3px;display:flex;align-items:center;gap:6px}
.ucard__loja-end .icon,.ucard__loja-tel .icon{width:13px;height:13px;flex-shrink:0}
.ucard__loja-tel a{color:#1f9d63;font-weight:600}
