/* Painel enxuto do Revendedor B e aba "Fornecedor" do Admin. Prefixo kb- para não colidir com o resto do painel.
   Usa os tokens do painel (--bg --surface --surface2 --line --fg --muted --accent). */
.kb-card { background: rgb(var(--surface) / .5); border: 1px solid rgb(var(--line)); border-radius: .85rem; }
.kb-divide > * + * { border-top: 1px solid rgb(var(--line) / .7); }
.kb-sect { font-weight: 800; font-size: 15px; color: rgb(var(--fg)); margin: 1.4rem .25rem .6rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.kb-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: rgb(var(--muted)); font-weight: 600; }
.kb-muted { color: rgb(var(--muted)); }
.kb-strong { color: rgb(var(--fg)); }
.kb-inp { width: 100%; background: rgb(var(--bg)); border: 1px solid rgb(var(--line)); border-radius: .75rem; padding: .55rem .75rem; color: rgb(var(--fg)); font-size: 16px; min-width: 0; min-height: 44px; }
.kb-inp:focus { outline: none; box-shadow: 0 0 0 1px rgb(var(--accent) / .6); border-color: rgb(var(--accent)); }
.kb-inp.kb-warnb { border-color: #fbbf24; }
select.kb-inp { appearance: none; }
.kb-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: 0 .9rem; border-radius: .75rem; font-weight: 600; font-size: 14px; border: 1px solid rgb(var(--line)); background: rgb(var(--surface2)); color: rgb(var(--fg)); text-align: center; line-height: 1.2; cursor: pointer; }
.kb-btn.kb-pri { background: rgb(var(--accent)); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -10px rgb(var(--accent) / .5); }
.kb-btn.kb-danger { color: #f87171; border-color: rgb(248 113 113 / .5); }
.kb-btn:disabled { opacity: .4; cursor: not-allowed; }
.kb-link { font-weight: 700; font-size: 12px; color: rgb(var(--accent)); min-height: 36px; padding: 0 .5rem; }
.kb-chip { flex-shrink: 0; min-height: 38px; padding: 0 .85rem; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid rgb(var(--line)); color: rgb(var(--muted)); white-space: nowrap; cursor: pointer; }
.kb-chip.on { color: rgb(var(--accent)); border-color: rgb(var(--accent)); background: rgb(var(--accent) / .1); }
.kb-chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.kb-pill { font-size: 11px; font-weight: 700; padding: .15rem .55rem; border-radius: 99px; display: inline-block; border: 1px solid; }
.kb-ok { color: #34d399; border-color: rgb(16 185 129 / .35); background: rgb(16 185 129 / .1); }
.kb-warn { color: #fbbf24; border-color: rgb(245 158 11 / .4); background: rgb(245 158 11 / .12); }
.kb-bad { color: #f87171; border-color: rgb(239 68 68 / .4); background: rgb(239 68 68 / .1); }
.kb-info { color: rgb(var(--accent)); border-color: rgb(var(--accent) / .4); background: rgb(var(--accent) / .1); }
.kb-off { color: rgb(var(--muted)); border-color: rgb(var(--line)); }
.kb-code { background: rgb(var(--bg)); border: 1px solid rgb(var(--line)); border-radius: .75rem; padding: .8rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; white-space: pre-wrap; word-break: break-word; color: rgb(var(--fg)); }
.kb-sw { width: 56px; height: 44px; position: relative; flex: none; background: none; border: 0; cursor: pointer; }
.kb-sw::before { content: ''; position: absolute; left: 5px; top: 8px; width: 46px; height: 28px; border-radius: 99px; background: rgb(var(--line)); transition: background .2s; }
.kb-sw::after { content: ''; position: absolute; top: 12px; left: 9px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.kb-sw.on::before { background: rgb(var(--accent)); } .kb-sw.on::after { transform: translateX(18px); } .kb-sw.lock { opacity: .4; }
.kb-step { display: flex; align-items: center; gap: .75rem; padding: .75rem; }
.kb-step .kb-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgb(var(--line)); display: flex; align-items: center; justify-content: center; flex: none; font-size: 13px; color: transparent; }
.kb-step.done .kb-dot { background: #10b981; border-color: #10b981; color: #fff; }
.kb-step.done .kb-t { color: rgb(var(--muted)); text-decoration: line-through; }
.kb-bar { flex: none; background: rgb(var(--accent)); border-radius: 6px 6px 2px 2px; min-height: 4px; opacity: .85; }
.kb-badge { display: inline-flex; min-width: 18px; height: 18px; border-radius: 99px; background: #f59e0b; color: #1c1917; font-size: 11px; font-weight: 800; align-items: center; justify-content: center; padding: 0 5px; margin-left: .35rem; }
.kb-nav-badge { margin-left: auto; min-width: 20px; height: 20px; border-radius: 99px; background: #f59e0b; color: #1c1917; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.kb-strike { text-decoration: line-through; color: rgb(var(--muted)); font-weight: 500; font-size: 13px; }
.kb-tab { flex-shrink: 0; }
#kb-toasts { position: fixed; top: 14px; right: 14px; z-index: 200; display: flex; flex-direction: column; gap: .5rem; max-width: calc(100vw - 28px); }
.kb-toast { display: flex; gap: .6rem; align-items: center; background: rgb(var(--surface)); border: 1px solid rgb(var(--line)); color: rgb(var(--fg)); border-radius: .75rem; padding: .7rem .9rem; font-size: 14px; box-shadow: 0 10px 30px -10px rgb(0 0 0 / .6); }
/* janela no meio da tela (mesmo molde da ficha do Admin) */
#kb-modal { position: fixed; inset: 0; z-index: 90; background: rgb(0 0 0 / .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
#kb-modal .kb-win { width: 100%; max-width: 32rem; max-height: min(90dvh, 760px); display: flex; flex-direction: column; background: rgb(var(--bg)); border: 1px solid rgb(var(--line)); border-radius: 1.25rem; overflow: hidden; box-shadow: 0 30px 80px -20px rgb(0 0 0 / .7); animation: kbPop .18s ease-out; }
#kb-modal .kb-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .9rem 1rem; border-bottom: 1px solid rgb(var(--line) / .7); font-weight: 800; color: rgb(var(--fg)); }
#kb-modal .kb-body { overflow-y: auto; padding: 1rem; flex: 1; min-height: 0; color: rgb(var(--fg)); }
#kb-modal .kb-foot { padding: .8rem 1rem; border-top: 1px solid rgb(var(--line) / .7); display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding-bottom: max(.8rem, env(safe-area-inset-bottom)); }
.kb-x { width: 44px; height: 44px; flex: none; margin: -8px; border-radius: .7rem; color: rgb(var(--muted)); }
@keyframes kbPop { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
details.kb-det > summary { list-style: none; cursor: pointer; } details.kb-det > summary::-webkit-details-marker { display: none; }
details.kb-det[open] > summary .kb-chev { transform: rotate(180deg); }

/* Minha loja: apar�ncia e gateway */
.kb-themes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
@media (min-width: 640px) { .kb-themes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kb-theme { display: flex; align-items: center; gap: .5rem; min-height: 46px; padding: 0 .75rem; border-radius: 12px; border: 2px solid rgb(var(--line)); font-size: 13px; font-weight: 600; color: rgb(var(--fg)); text-align: left; cursor: pointer; }
.kb-theme.on { border-color: rgb(var(--accent)); background: rgb(var(--accent) / .1); }
.kb-tdot { width: 20px; height: 20px; border-radius: 999px; flex: none; border: 1px solid rgb(var(--line)); }
.kb-gws { display: grid; grid-template-columns: 1fr; gap: .5rem; }
@media (min-width: 640px) { .kb-gws { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kb-gw { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 48px; padding: .5rem .75rem; border-radius: 12px; border: 2px solid rgb(var(--line)); color: rgb(var(--fg)); cursor: pointer; text-align: left; }
.kb-gw.on { border-color: rgb(var(--accent)); background: rgb(var(--accent) / .1); }

/* dashboard do Início e tema do painel (Revendedor B) */
.kb-tile { background: rgb(var(--bg) / .55); border: 1px solid rgb(var(--line)); border-radius: .75rem; padding: .65rem .7rem; min-width: 0; }
.kb-dl { font-size: 11px; font-weight: 700; color: rgb(var(--muted)); }
.kb-dl-up { color: #34d399; } .kb-dl-down { color: #f87171; }
.kb-chart { display: block; width: 100%; height: auto; max-height: 220px; overflow: visible; }
.kb-bar { fill: rgb(var(--accent)); opacity: .6; transition: opacity .15s; }
.kb-bar.on { opacity: 1; }
.kb-axis { fill: rgb(var(--muted)); font-size: 17px; }
.kb-axisln { stroke: rgb(var(--line)); stroke-width: 1; }
.kb-empty-chart { text-align: center; padding: 1.5rem .5rem; color: rgb(var(--muted)); font-size: 13px; }
.kb-empty-chart i { font-size: 1.6rem; display: block; margin-bottom: .4rem; opacity: .6; }
.kb-meter { height: 8px; border-radius: 99px; background: rgb(var(--line) / .6); overflow: hidden; margin-top: 4px; }
.kb-meter span { display: block; height: 100%; border-radius: 99px; background: rgb(var(--accent)); }
.kb-ptheme { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
@media (min-width: 640px) { .kb-ptheme { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.kb-pth { display: flex; flex-direction: column; gap: .35rem; align-items: stretch; min-height: 44px; padding: .4rem; border-radius: .75rem; border: 2px solid rgb(var(--line)); background: transparent; color: rgb(var(--fg)); font-size: 11px; font-weight: 700; cursor: pointer; text-align: center; }
.kb-pth.on { border-color: rgb(var(--accent)); box-shadow: 0 0 0 1px rgb(var(--accent) / .4); }
.kb-pthb { display: block; height: 38px; border-radius: .5rem; }

/* Telegram do revendedor: passos numerados */
.kb-dot-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: rgb(var(--accent) / .15); color: rgb(var(--accent)); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; margin-top: 1px; }

/* Fornecedor: ícones de canal (liberado/bloqueado) na lista de revendedores */
.kb-ch { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; border: 1px solid rgb(var(--line)); }
.kb-ch.on { color: rgb(var(--accent)); background: rgb(var(--accent) / .12); border-color: rgb(var(--accent) / .4); }
.kb-ch.off { color: rgb(var(--muted)); opacity: .45; }

/* ===== 15/11: visual "Banco" do painel do Revendedor B (demo painel-b-conceitos.html, conceito 1) ===== */
.kb-lbl2 { font-size: 12px; font-weight: 700; color: rgb(var(--muted)); }
.kb-tap { min-height: 44px; display: inline-flex; align-items: center; }
body.kb-hide .kb-sens { filter: blur(8px); user-select: none; }
.kb-day { font-size: 12px; font-weight: 800; color: rgb(var(--muted)); text-transform: uppercase; letter-spacing: .06em; margin: 1.1rem .2rem .45rem; }
.kb-row { display: flex; align-items: center; gap: .75rem; padding: .7rem .85rem; min-height: 62px; }
.kb-ic { width: 42px; height: 42px; border-radius: .85rem; display: flex; align-items: center; justify-content: center; flex: none; font-size: 16px; font-weight: 800; background: rgb(var(--accent) / .13); color: rgb(var(--accent)); }
.kb-ic.sky { background: rgb(56 189 248 / .14); color: #38bdf8; }
.kb-ic.amber { background: rgb(245 158 11 / .14); color: #f59e0b; }
.kb-ic.green { background: rgb(16 185 129 / .14); color: #10b981; }
.kb-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: .9rem; background: rgb(var(--surface2) / .6); border: 1px solid rgb(var(--line)); max-width: 100%; }
.kb-seg button { min-height: 44px; padding: 0 1.15rem; border-radius: .7rem; font-size: 14px; font-weight: 700; color: rgb(var(--muted)); white-space: nowrap; }
.kb-seg button.on { background: rgb(var(--accent) / .16); color: rgb(var(--accent)); }
[id^="page-b-"] .kb-chip { min-height: 44px; }
/* Início: duas colunas só em tela larga */
.kb-bk-cols { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 2rem; }
@media (min-width: 1200px) { .kb-bk-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .kb-bk-cols .kb-bk-first { margin-top: 0; } }
.kb-bk-card { position: relative; overflow: hidden; container-type: inline-size; border-radius: 1.4rem; padding: 1.1rem 1.15rem 1.05rem; color: #fff; background: linear-gradient(135deg, rgb(var(--accent)), rgb(var(--accent2))); box-shadow: 0 22px 44px -26px rgb(var(--accent) / .75); }
.kb-bk-card::before, .kb-bk-card::after { content: ''; position: absolute; border-radius: 50%; background: rgb(255 255 255 / .09); pointer-events: none; }
.kb-bk-card::before { width: 220px; height: 220px; right: -70px; top: -90px; }
.kb-bk-card::after { width: 160px; height: 160px; right: 40px; bottom: -110px; }
.kb-bk-card > * { position: relative; }
.kb-bk-bal { font-size: clamp(26px, 13cqw, 46px); font-weight: 900; letter-spacing: -.03em; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; margin-top: .15rem; }
.kb-bk-eye { width: 44px; height: 44px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; background: rgb(255 255 255 / .16); margin: -6px -6px -6px 0; }
.kb-bk-pill { display: inline-flex; align-items: center; gap: .35rem; flex-wrap: wrap; font-size: 12px; font-weight: 700; padding: .3rem .65rem; border-radius: 99px; background: rgb(255 255 255 / .18); }
.kb-bk-prog { height: 6px; border-radius: 99px; background: rgb(255 255 255 / .25); overflow: hidden; }
.kb-bk-prog > i { display: block; height: 100%; background: #fff; border-radius: 99px; }
.kb-bk-acts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.kb-bk-act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; min-height: 84px; border-radius: 1.05rem; font-size: 12px; font-weight: 700; line-height: 1.15; text-align: center; padding: .4rem .15rem; color: rgb(var(--fg)); background: rgb(var(--surface) / .5); border: 1px solid rgb(var(--line)); cursor: pointer; }
.kb-bk-act i { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 17px; background: rgb(var(--accent) / .14); color: rgb(var(--accent)); }
.kb-bk-tile { background: rgb(var(--surface) / .5); border: 1px solid rgb(var(--line)); border-radius: .9rem; padding: .6rem .7rem; min-width: 0; container-type: inline-size; }
.kb-bk-tv { font-size: clamp(14px, 13cqw, 20px); font-weight: 800; color: rgb(var(--fg)); white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1.25; }
/* Preços: custo em destaque, campo do preço sempre aberto e lucro ao lado */
.kb-bk-cost { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .45rem; padding: .4rem .75rem; border-radius: .8rem; font-size: 13px; font-weight: 600; color: rgb(var(--muted)); background: rgb(var(--surface2) / .7); border: 1px solid rgb(var(--line)); }
.kb-bk-cost b { color: rgb(var(--fg)); font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kb-bk-cost s { font-size: 12px; white-space: nowrap; }
.kb-bk-cost i { color: rgb(var(--accent)); font-size: 12px; align-self: center; }
.kb-bk-prow { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: .75rem; align-items: end; }
.kb-bk-pin { display: flex; align-items: center; gap: .4rem; min-height: 52px; padding: 0 .75rem; margin-top: .3rem; border-radius: .9rem; background: rgb(var(--surface2) / .55); border: 1.5px solid rgb(var(--accent) / .55); cursor: text; }
.kb-bk-pin:focus-within { border-color: rgb(var(--accent)); box-shadow: 0 0 0 3px rgb(var(--accent) / .2); }
.kb-bk-pin.warn { border-color: #f59e0b; }
.kb-bk-pin input { flex: 1; min-width: 0; height: 50px; background: transparent; border: 0; outline: 0; font-size: 20px; font-weight: 800; color: rgb(var(--fg)); font-variant-numeric: tabular-nums; }
.kb-bk-pin i { color: rgb(var(--accent)); font-size: 13px; }
.kb-bk-gain { container-type: inline-size; min-width: 0; padding-bottom: .15rem; }
.kb-bk-gv { font-size: clamp(16px, 15cqw, 24px); font-weight: 800; white-space: nowrap; line-height: 1.2; font-variant-numeric: tabular-nums; }
/* barra de baixo (celular) */
#kb-bbar { display: none; }
.kb-bt { position: relative; min-height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 700; color: rgb(var(--muted)); background: none; border: 0; cursor: pointer; }
.kb-bt i { font-size: 18px; }
.kb-bt.on { color: rgb(var(--accent)); }
.kb-bt.kb-bt-fab { color: rgb(var(--fg)); }
.kb-bfab { width: 54px; height: 54px; border-radius: 18px; display: flex; align-items: center; justify-content: center; margin-top: -26px; color: #fff; background: linear-gradient(135deg, rgb(var(--accent)), rgb(var(--accent2))); border: 3px solid rgb(var(--bg)); box-shadow: 0 12px 26px -10px rgb(var(--accent) / .7); }
.kb-bfab i { font-size: 20px; }
.kb-bdot { position: absolute; top: 10px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; }
@media (max-width: 767px) {
    #kb-bbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgb(var(--surface) / .97); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid rgb(var(--line) / .8); padding-bottom: env(safe-area-inset-bottom); }
    body.kb-b #dashboard-layout > main { padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
    body.kb-b #dash-scroll-top { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { body.kb-hide .kb-sens { transition: none; } }
