﻿/* ============================================================
   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;
}

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: #2b2b2b;
    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(255,255,255,.12) transparent;
}
/* Chrome / Edge / Safari */
.sidebar::-webkit-scrollbar              { width: 4px; }
.sidebar::-webkit-scrollbar-track       { background: transparent; }
.sidebar::-webkit-scrollbar-thumb       { background: rgba(255,255,255,.12); border-radius: 99px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.25); }

/* 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(255,255,255,.07);
}

.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(255,255,255,.35);
    font-size: .7rem;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.sidebar__section {
    color: rgba(255,255,255,.25);
    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(255,255,255,.5);
    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(255,255,255,.05);
    color: rgba(255,255,255,.85);
}

.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(255,255,255,.07);
}

/* ── Área principal ────────────────────────────────────────── */
.admin-main {
    margin-left: 230px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 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;
}

/* ── Content ───────────────────────────────────────────────── */
.content {
    padding: 28px;
    flex: 1;
}

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

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

.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;
}

/* ── Widget ────────────────────────────────────────────────── */
.widget {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: var(--sombra);
}

.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: 14px;
    padding: 26px;
    box-shadow: var(--sombra);
    margin-bottom: 20px;
    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: 1.1rem;
    font-weight: 700;
    color: #2b2b2b;
    margin-bottom: 22px;
}

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

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

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

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

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

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: .77rem;
    color: #94a3b8;
    margin-top: 3px;
}

/* ── 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 dashed #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: 10px;
    padding: 10px 14px;
    border: 1.5px solid #dcdcdc;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #4a4a4a;
    font-size: .86rem;
    margin-bottom: 8px;
    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(255,255,255,.5);
    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(255,255,255,.05); color: rgba(255,255,255,.85); }
.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(255,255,255,.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; }
.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 .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; }

/* ── 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 { 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__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__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: 10px;
    margin-top: 14px;
}

/* ── 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__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__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: 142px; text-align: center; white-space: nowrap; }

/* Coluna Empresa */
.emp-name { font-size: .9rem; line-height: 1.3; }
.emp-name strong { color: #2b2b2b; }
.emp-name small  { color: #969899; font-weight: 400; }
.emp-meta { font-size: .74rem; color: #969899; margin-top: 2px; word-break: break-word; }

/* 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: 32px;
    height: 32px;
    padding: 0;
    border-radius: 7px;
    font-size: .9rem;
}
.emp-table .c-acts .btn-icon + .btn-icon { margin-left: 6px; }

/* ── 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; }
.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-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;
}
.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; }
.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; }

@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; }

/* ============================================================
   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; }
}
