* { box-sizing: border-box; }
:root { --h: 54px; --rail: 66px; --rail-open: 200px; --panel: 330px; }
body { margin: 0; font: 15px/1.4 system-ui, sans-serif; background: #f4f5f7; color: #1a1a2e; }

header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem 1.25rem; min-height: var(--h);
  background: #12203a; color: #fff; flex-wrap: wrap;
}
header .logo {
  height: 30px; width: auto;
  position: absolute; left: 50%; transform: translateX(-50%);
  pointer-events: none;
}
header .spacer { flex: 1; }
@media (max-width: 620px) {
  header .logo { position: static; transform: none; }
}
.tag { font-size: .72rem; padding: .15rem .5rem; border-radius: 999px; background: #2e7d32; }
.tag.sim { background: #b26a00; }

/* indicador "vendo como" no topo (modo ghost do admin) */
#vendo { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem;
  background: #ffffff1f; border: 1px solid #ffffff33; border-radius: 999px; padding: .15rem .3rem .15rem .7rem; }
#vendo b { font-weight: 600; }
#vendo button { padding: .1rem .5rem; font-size: .72rem; border-radius: 999px; background: #ffffff2e; }

/* ícones (SVG line, herda a cor) */
svg.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }

button { padding: .5rem .8rem; border: 0; border-radius: 8px; background: #12203a; color: #fff; font: inherit; cursor: pointer; }
button.del { background: #c0392b; }
button.push { background: #2e7d32; }
button.push.mini { padding: .3rem .6rem; font-size: .85rem; }
button:disabled { opacity: .45; cursor: default; }
button.ghost { background: transparent; border: 1px solid #c8ccd4; color: #12203a; }
header button.ghost { border-color: #ffffff55; color: #fff; }

input { padding: .5rem .6rem; border: 1px solid #c8ccd4; border-radius: 8px; font: inherit; background: #fff; }

/* ---------- layout ---------- */
.wrap { display: flex; align-items: flex-start; }

#sidebar {
  position: sticky; top: var(--h); align-self: flex-start;
  height: calc(100vh - var(--h)); display: flex; z-index: 10;
}
.rail {
  width: var(--rail); flex: none; background: #1b2c48; color: #fff;
  display: flex; flex-direction: column; padding: .5rem .35rem;
  transition: width .18s ease; overflow: hidden;
}
#sidebar.expanded .rail { width: var(--rail-open); }
/* grupo de cima: rola sozinho se não couber (a barra fica travada) */
.rail-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: .25rem; scrollbar-width: thin; }
.rail-scroll::-webkit-scrollbar { width: 4px; }
.rail-scroll::-webkit-scrollbar-thumb { background: #ffffff33; border-radius: 4px; }
.rail-bottom { flex: none; display: flex; flex-direction: column; gap: .25rem;
  margin-top: .35rem; padding-top: .35rem; border-top: 1px solid #ffffff1a; }
.rail-btn {
  position: relative;
  display: flex; align-items: center; gap: .65rem; width: 100%;
  background: transparent; color: #aeb9cc; padding: .58rem .5rem; border-radius: 8px;
  white-space: nowrap;
}
#sidebar:not(.expanded) .rail-btn { justify-content: center; padding: .58rem 0; }
.rail-btn:hover { background: #ffffff14; color: #e8edf5; }
.rail-btn.on { background: #2f8f46; color: #fff; }
.rail-btn .ic { width: 22px; height: 22px; flex: none; display: flex; align-items: center; justify-content: center; }
.rail-btn .ic svg.ic { width: 20px; height: 20px; }
#rail-foto svg.ic { stroke: currentColor; }
.rail-btn .lb { display: none; font-size: .88rem; }
#sidebar.expanded .rail-btn .lb { display: inline; }
/* contador: só no modo expandido fica na linha; recolhido vira selo no canto */
.rail-btn b {
  position: absolute; top: 3px; right: 4px; min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  background: #ffffff22; border-radius: 999px; padding: 0 3px; font-size: .7rem; line-height: 1;
}
.rail-btn b.hot { background: #e8a33d; color: #12203a; }
.rail-btn b:not(.hot) { display: none; }
#sidebar.expanded .rail-btn b { position: static; margin-left: auto; height: auto; }
#toggle-ic { transition: transform .18s ease; transform: rotate(180deg); }
#sidebar.expanded #toggle-ic { transform: none; }

.panel {
  width: 0; overflow: hidden; background: #fff; border-right: 1px solid #e4e7ec;
  transition: width .2s ease; height: 100%; overflow-y: auto;
}
#sidebar.open .panel { width: var(--panel); padding: 1rem 1.1rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.panel-head h2 { margin: 0; font-size: 1.05rem; }
.panel label { display: block; margin: .9rem 0 .35rem; font-weight: 600; font-size: .9rem; }
.panel label small { font-weight: 400; color: #889; }
.panel input { width: 100%; }
.panel hr { border: 0; border-top: 1px solid #e4e7ec; margin: 1.1rem 0 .2rem; }
.panel .row { display: flex; gap: .4rem; }
.panel .row input { flex: 1; }
.panel #salvar-config, .panel #enviar-pendentes { width: 100%; margin-top: 1.1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.chip { background: #eef1f5; border-radius: 999px; padding: .2rem .5rem .2rem .7rem; font-size: .85rem; cursor: pointer; }
.chip b { margin-left: .35rem; color: #c0392b; cursor: pointer; }
.hint { font-size: .82rem; color: #778; margin: .6rem 0; }
.ok { color: #2e7d32; font-weight: 600; }
.pend-item { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid #eef0f3; }
.pend-item span { flex: 1; }

.contato-link { display: flex; align-items: center; gap: .7rem; padding: .7rem .5rem; margin-top: .4rem;
  border: 1px solid #e4e7ec; border-radius: 10px; text-decoration: none; color: #12203a; }
.contato-link:hover { background: #f6f8fb; }
.contato-link svg.ic { width: 24px; height: 24px; color: #12203a; }
.contato-link b { display: block; font-size: .95rem; }
.contato-link small { color: #778; }

/* ---------- main ---------- */
main { flex: 1; min-width: 0; padding: 1.5rem 1.75rem; max-width: 1320px; }
#form { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
#form input { flex: 1 1 130px; }
#form #nome { flex: 2 1 240px; }
.busca { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.busca #q { flex: 1; }
.busca #conta { font-size: .82rem; color: #667; white-space: nowrap; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px #0001; table-layout: fixed; }
th, td { padding: .55rem .6rem; text-align: left; border-bottom: 1px solid #eef0f3; }
th { background: #fafbfc; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #667; }
th:nth-child(1) { width: 26%; }          /* produto  */
th:nth-child(2) { width: 92px; }         /* preço    */
th:nth-child(3) { width: 22%; }          /* cód barras */
th:nth-child(4) { width: 17%; }          /* MAC      */
th:nth-child(5) { width: 116px; }        /* prévia   */
th:nth-child(6) { width: 190px; }        /* ações    */
td { position: relative; vertical-align: middle; }
td input { width: 100%; }
td .e-nome, td .e-barcode, td .e-mac { text-overflow: ellipsis; }
td.acts { white-space: nowrap; }
td.acts button + button { margin-left: .3rem; }
td.acts button { padding: .4rem .5rem; font-size: .85rem; }
@media (max-width: 900px) { table { table-layout: auto; } th { width: auto !important; } }
td img { border: 1px solid #ddd; border-radius: 4px; vertical-align: middle; background: #fff; cursor: zoom-in; }

#lightbox {
  position: fixed; inset: 0; z-index: 40; background: #000a;
  display: flex; align-items: center; justify-content: center; padding: 2rem;
}
#lightbox img {
  width: min(92vw, 900px); height: auto; background: #fff;
  border-radius: 8px; box-shadow: 0 12px 40px #0007;
  image-rendering: pixelated;
}
#lb-close {
  position: absolute; top: 1rem; right: 1rem; width: 42px; height: 42px;
  border-radius: 50%; background: #fff; color: #12203a; font-size: 1.1rem;
}
tr.pend td:first-child { box-shadow: inset 3px 0 0 #e8a33d; }
tr.falhou td:first-child { box-shadow: inset 3px 0 0 #c0392b; }
.dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #e8a33d; }
.dot.red { background: #c0392b; }

.falha-item { display: flex; align-items: center; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid #eef0f3; }
.falha-item .fi-ic { font-size: 1.2rem; }
.falha-item .fi-txt { flex: 1; }
.falha-item .fi-txt b { display: block; font-size: .92rem; }
.falha-item .fi-txt small { color: #b3261e; }

#scrim { position: fixed; inset: var(--h) 0 0 0; background: #0005; z-index: 9; }

@media (max-width: 760px) {
  #sidebar { position: fixed; top: var(--h); left: 0; }
  #sidebar.open .panel { position: fixed; left: var(--rail); top: var(--h); bottom: 0;
    width: min(320px, calc(100vw - var(--rail))); }
  main { padding-left: calc(var(--rail) + 1rem); }
}

/* ---------- ghost bar ---------- */
#ghost-bar {
  position: sticky; top: var(--h); z-index: 15;
  background: #4a2c74; color: #fff; padding: .5rem 1.25rem;
  display: flex; align-items: center; gap: .5rem; font-size: .9rem;
}
#ghost-bar small { opacity: .8; }
#ghost-bar button { margin-left: auto; }
#ghost-bar button.ghost { border-color: #ffffff66; color: #fff; }

/* ---------- toasts ---------- */
#toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 60; display: flex; flex-direction: column; gap: .5rem; }
.toast {
  display: flex; align-items: center; gap: .55rem;
  background: #12203a; color: #fff; padding: .7rem .9rem; border-radius: 10px;
  box-shadow: 0 8px 24px #0004; max-width: 340px; font-size: .9rem;
  transform: translateY(12px); opacity: 0; transition: all .22s ease;
}
.toast.show { transform: none; opacity: 1; }
.toast.ok { background: #1e7d3c; }
.toast.err { background: #b3261e; }
.toast .t-ic { font-size: 1.1rem; }

/* ---------- confirm modal ---------- */
.modal { position: fixed; inset: 0; z-index: 55; background: #0007; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.modal-box { background: #fff; border-radius: 14px; padding: 1.3rem 1.4rem; max-width: 380px; width: 100%; box-shadow: 0 20px 60px #0006; }
.modal-box h3 { margin: 0 0 .5rem; font-size: 1.1rem; }
.modal-box p { margin: 0 0 1.2rem; color: #445; }
.modal-acts { display: flex; gap: .6rem; justify-content: flex-end; }
button.danger { background: #c0392b; }

.rail-sep { height: 1px; background: #ffffff1f; margin: .4rem .3rem; flex: none; }

/* selects: mesma cara dos inputs */
select { padding: .5rem .55rem; border: 1px solid #c8ccd4; border-radius: 8px; font: inherit; background: #fff; }
.panel select { width: 100%; }

/* ---------- perfil ---------- */
.perfil-top { display: flex; gap: .9rem; align-items: center; margin-bottom: 1rem; }
.perfil-top > div { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.perfil-top b { font-size: .95rem; word-break: break-all; }
.perfil-top small { color: #778; }
.avatar-lg { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #dfe3ea; flex: none; }
.avatar-sm { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; vertical-align: middle; }
.file-btn { display: inline-block; margin-top: .3rem; font-size: .82rem; color: #12203a;
  border: 1px solid #c8ccd4; border-radius: 8px; padding: .3rem .6rem; cursor: pointer; font-weight: 500; }
.file-btn:hover { background: #f2f4f7; }
#perfil #logout { width: 100%; margin-top: 1rem; }

/* card genérico dentro do painel */
.card-p { border: 1px solid #e6e9ef; border-radius: 14px; padding: .9rem; margin: .7rem 0;
  background: #ffffff; box-shadow: 0 4px 16px #12203a10; }
.card-p h3 { margin: 0 0 .5rem; font-size: .95rem; }
.card-p label { display: block; margin: .6rem 0 .3rem; font-weight: 600; font-size: .85rem; }
.card-p label small { font-weight: 400; color: #889; }
.card-p input, .card-p select { width: 100%; }
.card-p input + input { margin-top: .5rem; }
.card-p button { margin-top: .7rem; width: 100%; }

/* ---------- cards de loja (escolha / trocar) ---------- */
.loja-cards { display: flex; flex-direction: column; gap: .55rem; }
.loja-card { display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left;
  background: #fff; border: 1px solid #e6e9ef; border-radius: 14px; padding: .7rem .8rem;
  color: #12203a; cursor: pointer; box-shadow: 0 4px 16px #12203a10;
  transition: transform .12s ease, box-shadow .12s ease; }
.loja-card:hover { transform: translateY(-1px); box-shadow: 0 10px 30px #12203a1f; }
.lc-foto { width: 46px; height: 46px; border-radius: 10px; flex: none; background: #eef1f5 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; color: #8b93a3; }
.lc-foto svg.ic { width: 22px; height: 22px; }
.loja-cards.grande .lc-foto svg.ic { width: 34px; height: 34px; }
.lc-info { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.lc-info b { font-size: .98rem; }
.lc-info small { color: #778; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-meta { color: #99a !important; }

.loja-cards.grande { max-width: 640px; }
.loja-cards.grande .loja-card { padding: 1rem 1.1rem; gap: 1.1rem; }
.loja-cards.grande .lc-foto { width: 84px; height: 84px; border-radius: 14px; font-size: 2rem; }
.loja-cards.grande .lc-info b { font-size: 1.25rem; }
.loja-cards.grande .lc-info small { font-size: .9rem; }

#escolha-loja { padding: 2.5rem 0; }
.escolha-titulo { font-size: 1.5rem; margin: 0 0 .3rem; }

/* ---------- gerenciar lojas ---------- */
.adm-loja { position: relative; }
.adm-loja input { width: 100%; margin-top: .45rem; }
.adm-loja input:first-of-type { margin-top: 0; }
.cfg-foto { margin-bottom: .3rem; }
.cfg-foto .row { margin-top: .4rem; }
.al-foto svg.ic { width: 28px; height: 28px; color: #8b93a3; }
.al-foto { width: 100%; height: 96px; border-radius: 10px; background: #eef1f5 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 2rem; position: relative; margin-bottom: .3rem; }
.al-cam { position: absolute; right: 6px; bottom: 6px; background: #fff; border: 1px solid #d5d9e0;
  border-radius: 8px; padding: .15rem .4rem; font-size: .95rem; cursor: pointer; }
.au-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .6rem; }
.au-head small { color: #778; font-size: .78rem; }
.mini { padding: .35rem .6rem !important; font-size: .82rem !important; width: auto !important; margin: 0 !important; }

/* ---------- acessos ---------- */
.adm-user .au-head b { font-size: .9rem; word-break: break-all; }
.badge { font-size: .72rem; padding: .12rem .5rem; border-radius: 999px; background: #e7ebf1; color: #445; white-space: nowrap; }
.badge.admin { background: #4a2c74; color: #fff; }
.au-acts { display: flex; gap: .4rem; margin-top: .5rem; }
.au-form { display: flex; gap: .4rem; margin-top: .5rem; flex-wrap: wrap; }
.au-form input { flex: 1 1 140px; margin: 0; }

.bg-preview { width: 100%; max-height: 150px; object-fit: cover; border-radius: 10px; margin-bottom: .5rem; }

/* ---------- logs ---------- */
#logs-filtro, #logs-q { width: 100%; }
.log-item { display: flex; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid #eef0f3; }
.li-ic { font-size: 1.05rem; flex: none; }
.li-txt { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.li-txt b { font-size: .86rem; font-weight: 500; }
.li-txt small { color: #889; font-size: .76rem; }
.li-user { color: #4a2c74 !important; font-weight: 600; }

/* ---------- recorte de foto ---------- */
#crop-stage { width: 260px; height: 260px; margin: 0 auto; }
#crop-canvas { display: block; background: #111; border-radius: 8px; touch-action: none; cursor: grab; }
#crop-canvas:active { cursor: grabbing; }

/* ---------- login (mesmo estilo do portal telemetria) ---------- */
.login-body { min-height: 100vh; background: #050810; color: #e6f7ff; }
#login-bg { position: fixed; inset: 0; background: #050810 center/cover no-repeat; z-index: 0; }
#login-bg::after { content: ""; position: absolute; inset: 0; background: #050810cc; }
.login-body.has-bg #login-bg::after { background: #050810b0; }

.wrapper-login { position: relative; z-index: 1; min-height: 100vh; display: flex;
  flex-direction: column; align-items: center; justify-content: center; padding: 20px; }

.card-login { width: 100%; max-width: 380px; background: #000;
  border: 1px solid rgba(0, 217, 255, 0.35); border-radius: 22px; padding: 40px 34px;
  box-shadow: 0 0 40px rgba(0, 217, 255, 0.10); text-align: center; }

.logo-login { display: block; margin: 0 auto 4px; width: 300px; max-width: 100%; height: 150px;
  object-fit: contain; background: transparent; }

.subtitulo-login { font-family: "Orbitron", "Segoe UI", sans-serif; font-weight: 600;
  color: #00d9ff; font-size: 17px; letter-spacing: 3px; text-transform: uppercase;
  text-shadow: 0 0 12px rgba(0,217,255,.35), 0 0 2px #00d9ff; margin: 6px 0 30px; }

.form-login { display: flex; flex-direction: column; align-items: stretch; text-align: left; }
.form-login label { font-size: 12px; color: #7fa7b8; letter-spacing: .5px; margin-bottom: 6px; display: block; }
.form-login input { display: block; width: 100%; height: 46px; padding: 0 14px; background: #0f1622;
  border: 1px solid rgba(0,217,255,.35); border-radius: 12px; color: #e6f7ff; font-size: 14px;
  margin: 0 0 20px; box-sizing: border-box; -webkit-appearance: none; appearance: none; }
.form-login input:focus { outline: none; border-color: #00d9ff; box-shadow: 0 0 0 3px rgba(0,217,255,.15); }
/* Chrome/Safari: neutraliza o autofill (deixava o campo de e-mail branco e "maior") */
.form-login input:-webkit-autofill,
.form-login input:-webkit-autofill:hover,
.form-login input:-webkit-autofill:focus {
  -webkit-text-fill-color: #e6f7ff; caret-color: #e6f7ff;
  -webkit-box-shadow: 0 0 0 1000px #0f1622 inset;
  transition: background-color 9999s ease-in-out 0s;
}
/* campo escuro também quando o Chrome mostra/seleciona a sugestão de e-mail salvo (clicar no campo deixava tudo branco) */
.form-login input, html[data-tema] .form-login input { color-scheme: dark; }
.form-login input:-webkit-autofill, html[data-tema] .form-login input:-webkit-autofill,
.form-login input:autofill, html[data-tema] .form-login input:autofill,
.form-login input:-internal-autofill-previewed, .form-login input:-internal-autofill-selected {
  -webkit-text-fill-color: #e6f7ff !important; caret-color: #e6f7ff !important;
  -webkit-box-shadow: 0 0 0 1000px #0f1622 inset !important; box-shadow: 0 0 0 1000px #0f1622 inset !important;
  background-color: #0f1622 !important; color: #e6f7ff !important;
}
.campo-senha { position: relative; margin-bottom: 20px; }
.campo-senha input { margin-bottom: 0; padding-right: 40px; }
.campo-senha input::-ms-reveal, .campo-senha input::-ms-clear { display: none; }
.olho-senha { position: absolute; right: 12px; top: 23px; transform: translateY(-50%);
  cursor: pointer; opacity: .7; user-select: none; font-size: 1.05rem; }
.olho-senha:hover { opacity: 1; }

.botao-ios { display: block; width: 100%; margin: 14px 0 0; padding: 14px; border: none; border-radius: 999px;
  background: linear-gradient(180deg, #00e5ff, #00a0d6); color: #001018; font-size: 16px;
  font-weight: 700; letter-spacing: .3px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,217,255,.35); transition: transform .15s, box-shadow .15s; }
.botao-ios:hover { box-shadow: 0 8px 26px rgba(0,217,255,.5); }
.botao-ios:active { transform: scale(.97); }
.botao-ios:disabled { opacity: .6; }

.login-erro { color: #ff9a90; font-size: .85rem; margin: .9rem 0 0; text-align: center; }

/* ---------- balões flutuantes de contato ---------- */
#contato-flutua { position: fixed; right: 16px; bottom: 16px; z-index: 45;
  display: flex; flex-direction: column; gap: .5rem; }
.cf-bolha { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: 0 6px 20px #0003; transition: transform .12s ease; }
.cf-bolha:hover { transform: translateY(-2px) scale(1.05); }
.cf-bolha svg.ic { width: 24px; height: 24px; }
.cf-bolha.wa { background: #25d366; }
.cf-bolha.ig { background: linear-gradient(45deg, #f09433, #dc2743 45%, #bc1888); }
@media (max-width: 760px) { #contato-flutua { right: 10px; bottom: 10px; } .cf-bolha { width: 42px; height: 42px; } }

/* ============ TEMAS ============ */
/* claro = estilos base acima. Os blocos abaixo sobrescrevem as superfícies. */

/* ---- PRETO (padrão) ---- */
[data-tema="escuro"] body { background: #0d1420; color: #e8edf5; }
[data-tema="escuro"] header { background: #0a1120; }
[data-tema="escuro"] .rail { background: #0b1322; }
[data-tema="escuro"] .panel { background: #131c2b; border-right-color: #23304a; }
[data-tema="escuro"] .panel-head h2, [data-tema="escuro"] h1, [data-tema="escuro"] h2, [data-tema="escuro"] h3 { color: #eef2f8; }
[data-tema="escuro"] .panel label { color: #cdd6e5; }
[data-tema="escuro"] input, [data-tema="escuro"] select,
[data-tema="escuro"] .card-p input, [data-tema="escuro"] .card-p select {
  background: #0f1a29; border-color: #2a3958; color: #e8edf5; }
[data-tema="escuro"] input::placeholder { color: #6b7a92; }
[data-tema="escuro"] table { background: #131c2b; box-shadow: none; border: 1px solid #23304a; }
[data-tema="escuro"] th { background: #16202f; color: #9fb0c8; }
[data-tema="escuro"] td { border-bottom-color: #222f47; }
[data-tema="escuro"] main { color: #e8edf5; }
[data-tema="escuro"] .card-p { background: #16202f; border-color: #26324a; box-shadow: none; }
[data-tema="escuro"] .loja-card { background: #16202f; border-color: #2a3a57; color: #e8edf5; box-shadow: none; }
[data-tema="escuro"] .lc-foto, [data-tema="escuro"] .al-foto { background-color: #1c2a3e; color: #7f8ea6; }
[data-tema="escuro"] .contato-link { background: #16202f; border-color: #26324a; color: #e8edf5; }
[data-tema="escuro"] .contato-link:hover { background: #1c2a3e; }
[data-tema="escuro"] .contato-link svg.ic { color: #cdd6e5; }
[data-tema="escuro"] button.ghost { border-color: #34435f; color: #cdd6e5; }
[data-tema="escuro"] .modal-box { background: #16202f; color: #e8edf5; }
[data-tema="escuro"] .modal-box p { color: #b6c2d6; }
[data-tema="escuro"] .hint, [data-tema="escuro"] .texto-fraco { color: #8b98ac; }
[data-tema="escuro"] .log-item { border-bottom-color: #222f47; }
[data-tema="escuro"] .badge { background: #26324a; color: #cdd6e5; }
[data-tema="escuro"] .file-btn { border-color: #34435f; color: #cdd6e5; }
[data-tema="escuro"] .file-btn:hover { background: #1c2a3e; }
[data-tema="escuro"] .au-head { border-bottom-color: #222f47; }
[data-tema="escuro"] .busca #conta, [data-tema="escuro"] small { color: #8b98ac; }

/* ---- VIDRO (translúcido, SEM blur — blur trava a máquina) ---- */
[data-tema="vidro"] body { color: #eaf1fb;
  background: linear-gradient(160deg, #16233d, #0b1220 60%); }
[data-tema="vidro"] header { background: #101c33; }
[data-tema="vidro"] .rail { background: #0d1830; }
[data-tema="vidro"] .panel { background: #16243f; border-right-color: rgba(255,255,255,.12); }
[data-tema="vidro"] .panel-head h2, [data-tema="vidro"] h1, [data-tema="vidro"] h2, [data-tema="vidro"] h3 { color: #f2f7ff; }
[data-tema="vidro"] .panel label { color: #cfdcf0; }
[data-tema="vidro"] input, [data-tema="vidro"] select { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); color: #eaf1fb; }
[data-tema="vidro"] input::placeholder { color: #ffffff66; }
[data-tema="vidro"] table { background: #16243f; box-shadow: none; border: 1px solid rgba(255,255,255,.1); }
[data-tema="vidro"] th { background: rgba(255,255,255,.05); color: #b8c6de; }
[data-tema="vidro"] td { border-bottom-color: rgba(255,255,255,.08); }
[data-tema="vidro"] main { color: #eaf1fb; }
[data-tema="vidro"] .card-p, [data-tema="vidro"] .loja-card, [data-tema="vidro"] .contato-link, [data-tema="vidro"] .modal-box {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: #eaf1fb; box-shadow: 0 6px 22px #0005; }
[data-tema="vidro"] .lc-foto, [data-tema="vidro"] .al-foto { background-color: rgba(255,255,255,.1); color: #cfdcf0; }
[data-tema="vidro"] button.ghost, [data-tema="vidro"] .file-btn { border-color: rgba(255,255,255,.25); color: #eaf1fb; }
[data-tema="vidro"] .hint, [data-tema="vidro"] small, [data-tema="vidro"] .busca #conta { color: #9fb0c8; }
[data-tema="vidro"] .badge { background: rgba(255,255,255,.14); color: #eaf1fb; }
[data-tema="vidro"] .log-item, [data-tema="vidro"] .au-head { border-bottom-color: rgba(255,255,255,.1); }

/* ---- VERDE TECNOLÓGICO (estilo telemetria) ---- */
[data-tema="tec"] body { background: #050810; color: #e6f7ff; }
[data-tema="tec"] header { background: #080c14; border-bottom: 1px solid rgba(0,217,255,.2); }
[data-tema="tec"] .rail { background: #070b12; }
[data-tema="tec"] .rail-btn.on { background: rgba(0,217,255,.16); color: #00d9ff; }
[data-tema="tec"] .panel { background: #0b0f1a; border-right-color: rgba(0,217,255,.2); }
[data-tema="tec"] .panel-head h2, [data-tema="tec"] h1, [data-tema="tec"] h2, [data-tema="tec"] h3 { color: #e6f7ff; }
[data-tema="tec"] .panel label { color: #9fc7d6; }
[data-tema="tec"] input, [data-tema="tec"] select { background: #0f1622; border-color: rgba(0,217,255,.3); color: #e6f7ff; }
[data-tema="tec"] input:focus, [data-tema="tec"] select:focus { border-color: #00d9ff; box-shadow: 0 0 0 3px rgba(0,217,255,.15); }
[data-tema="tec"] input::placeholder { color: #5b7f8e; }
[data-tema="tec"] table { background: #0b0f1a; box-shadow: 0 0 24px rgba(0,217,255,.08); border: 1px solid rgba(0,217,255,.18); }
[data-tema="tec"] th { background: #0f1622; color: #7fa7b8; }
[data-tema="tec"] td { border-bottom-color: rgba(0,217,255,.12); }
[data-tema="tec"] main { color: #e6f7ff; }
[data-tema="tec"] .card-p, [data-tema="tec"] .loja-card, [data-tema="tec"] .contato-link, [data-tema="tec"] .modal-box {
  background: #0b0f1a; border: 1px solid rgba(0,217,255,.22); color: #e6f7ff; box-shadow: 0 0 22px rgba(0,217,255,.08); }
[data-tema="tec"] .lc-foto, [data-tema="tec"] .al-foto { background-color: #0f1a24; color: #4c8296; }
[data-tema="tec"] button.ghost, [data-tema="tec"] .file-btn { border-color: rgba(0,217,255,.4); color: #cdeef7; }
[data-tema="tec"] button.push, [data-tema="tec"] .botao-ios { background: linear-gradient(180deg,#00e5ff,#00a0d6); color: #001018; }
[data-tema="tec"] .rail-btn.on { background: rgba(0,217,255,.18); color: #00d9ff; }
[data-tema="tec"] .hint, [data-tema="tec"] small, [data-tema="tec"] .busca #conta { color: #7fa7b8; }
[data-tema="tec"] .badge { background: rgba(0,217,255,.16); color: #cdeef7; }
[data-tema="tec"] .log-item, [data-tema="tec"] .au-head { border-bottom-color: rgba(0,217,255,.12); }
[data-tema="tec"] .escolha-titulo, [data-tema="tec"] .subtitulo-login { color: #00d9ff; }

/* seletor de tema (Aparência / Perfil) */
.tema-grade { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin-top: .3rem; }
.tema-opt { border: 2px solid transparent; border-radius: 12px; padding: .7rem .6rem; cursor: pointer;
  font-size: .85rem; font-weight: 600; text-align: center; color: #fff; }
.tema-opt.on { border-color: #2f8f46; box-shadow: 0 0 0 3px #2f8f4633; }
.tema-opt[data-t="escuro"] { background: #0d1420; }
.tema-opt[data-t="claro"] { background: #f4f5f7; color: #1a1a2e; border-color: #d7dbe2; }
.tema-opt[data-t="claro"].on { border-color: #2f8f46; }
.tema-opt[data-t="vidro"] { background: linear-gradient(135deg, #24406b, #101b30); }
.tema-opt[data-t="tec"] { background: #050810; color: #00d9ff; border: 2px solid rgba(0,217,255,.35); }
.tema-opt[data-t="tec"].on { border-color: #2f8f46; }

[hidden] { display: none !important; }

/* =====================================================================
   IoT Now — redesign v2 (16/10/2026)
   Preto + ciano neon. Só visual: reaproveita toda a estrutura/JS.
   Tokens por tema; sem backdrop-filter (blur trava a máquina).
   ===================================================================== */
:root { --r: 14px; --ease: cubic-bezier(.2,.7,.2,1); }

html[data-tema="escuro"] {
  --bg: #050505; --s1: #0c0e0f; --s2: #121517; --s3: #181c1f; --ln: rgba(255,255,255,.08);
  --tx: #e9f4f8; --mu: #8d9ca4; --ac: #00d9ff; --ac2: #00a0d6; --ink: #001018;
  --hdr: #070809; --rail-bg: #070809; --glow: 0 0 0 transparent; --ringc: rgba(0,217,255,.35);
}
html[data-tema="tec"] {
  --bg: #030507; --s1: #090d12; --s2: #0e141b; --s3: #131b24; --ln: rgba(0,217,255,.2);
  --tx: #e6f7ff; --mu: #7fa7b8; --ac: #00e5ff; --ac2: #00a0d6; --ink: #001018;
  --hdr: #04070a; --rail-bg: #04070a; --glow: 0 0 26px rgba(0,217,255,.10); --ringc: rgba(0,229,255,.45);
}
html[data-tema="vidro"] {
  --bg: #07090d; --s1: rgba(255,255,255,.05); --s2: rgba(255,255,255,.08); --s3: rgba(255,255,255,.11);
  --ln: rgba(255,255,255,.14); --tx: #eef5fa; --mu: #9fb2c0; --ac: #36e0ff; --ac2: #1aa6d1; --ink: #001018;
  --hdr: #0a0d12; --rail-bg: #0a0d12; --glow: 0 8px 28px rgba(0,0,0,.45); --ringc: rgba(54,224,255,.35);
}
html[data-tema="claro"] {
  --bg: #f1f5f7; --s1: #ffffff; --s2: #f6f9fb; --s3: #eaf0f3; --ln: #dde5ea;
  --tx: #0d1a21; --mu: #5b6b75; --ac: #008fae; --ac2: #006f88; --ink: #ffffff;
  --hdr: #ffffff; --rail-bg: #0b161b; --glow: 0 6px 22px rgba(10,40,55,.08); --ringc: rgba(0,143,174,.3);
}

html[data-tema] body {
  background: var(--bg); color: var(--tx);
  font: 15px/1.45 "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
html[data-tema="escuro"] body, html[data-tema="tec"] body {
  background:
    radial-gradient(900px 420px at 8% -8%, rgba(0,217,255,.07), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, rgba(0,160,214,.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
html[data-tema="vidro"] body { background: radial-gradient(900px 500px at 10% -10%, rgba(54,224,255,.10), transparent 60%), var(--bg); background-attachment: fixed; }
html[data-tema] main { color: var(--tx); }
html[data-tema] h1, html[data-tema] h2, html[data-tema] h3, html[data-tema] .panel-head h2 { color: var(--tx); letter-spacing: -.01em; }
html[data-tema] small, html[data-tema] .hint, html[data-tema] .texto-fraco, html[data-tema] .busca #conta { color: var(--mu); }
html[data-tema] ::selection { background: var(--ac); color: var(--ink); }

/* ---------- topo ---------- */
html[data-tema] header {
  background: var(--hdr); color: var(--tx); border-bottom: 1px solid var(--ln);
  box-shadow: 0 1px 0 rgba(0,217,255,.06), 0 10px 30px rgba(0,0,0,.25);
}
html[data-tema="claro"] header { box-shadow: 0 1px 0 var(--ln); }
html[data-tema="claro"] header .logo { filter: invert(1) hue-rotate(180deg); }
html[data-tema] header .logo { height: 32px; }
html[data-tema] .tag { background: rgba(0,217,255,.14); color: var(--ac); border: 1px solid rgba(0,217,255,.35); font-weight: 600; letter-spacing: .02em; }
html[data-tema] .tag.sim { background: rgba(255,170,40,.12); color: #ffb648; border-color: rgba(255,170,40,.4); }
html[data-tema] #vendo { background: rgba(255,170,40,.12); border-color: rgba(255,170,40,.4); color: #ffcf87; }
html[data-tema] #vendo button { background: rgba(255,170,40,.2); color: #ffcf87; }
html[data-tema] #ghost-bar { background: #1b1405; color: #ffcf87; border-bottom: 1px solid rgba(255,170,40,.35); }

/* ---------- botões ---------- */
html[data-tema] button {
  background: var(--s3); color: var(--tx); border: 1px solid var(--ln); border-radius: 10px;
  font-weight: 600; letter-spacing: .005em; transition: transform .12s var(--ease), box-shadow .15s var(--ease), background .15s, border-color .15s;
}
html[data-tema] button:hover:not(:disabled) { border-color: var(--ringc); box-shadow: 0 0 0 3px rgba(0,217,255,.08); }
html[data-tema] button:active:not(:disabled) { transform: scale(.975); }
html[data-tema] button.push, html[data-tema] #salvar-config, html[data-tema] #enviar-pendentes, html[data-tema] .botao-ios {
  background: linear-gradient(180deg, var(--ac), var(--ac2)); color: var(--ink); border: 0;
  box-shadow: 0 6px 18px rgba(0,217,255,.25);
}
html[data-tema] button.push:hover:not(:disabled), html[data-tema] #salvar-config:hover:not(:disabled),
html[data-tema] #enviar-pendentes:hover:not(:disabled) { box-shadow: 0 8px 26px rgba(0,217,255,.45); border: 0; }
html[data-tema] button.ghost { background: transparent; border: 1px solid var(--ln); color: var(--tx); }
html[data-tema] header button.ghost { border-color: var(--ln); color: var(--tx); }
html[data-tema] button.del, html[data-tema] button.danger {
  background: rgba(255,82,82,.12); color: #ff8a80; border: 1px solid rgba(255,82,82,.35); }
html[data-tema] button.del:hover:not(:disabled), html[data-tema] button.danger:hover:not(:disabled) {
  background: #d63b3b; color: #fff; border-color: #d63b3b; box-shadow: 0 6px 18px rgba(214,59,59,.35); }

/* ---------- campos ---------- */
html[data-tema] input, html[data-tema] select, html[data-tema] .card-p input, html[data-tema] .card-p select {
  background: var(--s2); color: var(--tx); border: 1px solid var(--ln); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
html[data-tema] input::placeholder { color: var(--mu); opacity: .7; }
html[data-tema] input:focus, html[data-tema] select:focus {
  outline: none; border-color: var(--ac); box-shadow: 0 0 0 3px var(--ringc); background: var(--s1);
}
html[data-tema] .file-btn { border: 1px dashed var(--ln); color: var(--tx); border-radius: 10px; background: var(--s2); }
html[data-tema] .file-btn:hover { border-color: var(--ac); background: var(--s3); }

/* ---------- barra lateral ---------- */
html[data-tema] .rail { background: var(--rail-bg); border-right: 1px solid var(--ln); }
html[data-tema] .rail-btn { color: #8fa2ac; border-radius: 12px; transition: background .15s, color .15s; }
html[data-tema] .rail-btn:hover { background: rgba(0,217,255,.07); color: #d9f6ff; }
html[data-tema] .rail-btn.on { background: rgba(0,217,255,.14); color: var(--ac); box-shadow: inset 3px 0 0 var(--ac); }
html[data-tema="claro"] .rail-btn.on { color: #5ee7ff; }
html[data-tema] .rail-btn b.hot { background: #ffb648; color: #1a1100; }
html[data-tema] .rail-bottom, html[data-tema] .rail-sep { border-color: var(--ln); }
html[data-tema] .rail-sep { background: var(--ln); }
html[data-tema] #rail-foto img, html[data-tema] .avatar-sm { border-radius: 50%; }

html[data-tema] .panel { background: var(--s1); border-right: 1px solid var(--ln); box-shadow: var(--glow); }
html[data-tema] .panel label { color: var(--tx); opacity: .9; }
html[data-tema] .panel hr { border-top-color: var(--ln); }
html[data-tema] .chip { background: var(--s3); color: var(--tx); border: 1px solid var(--ln); }
html[data-tema] .pend-item, html[data-tema] .falha-item { border-bottom-color: var(--ln); }
html[data-tema] .falha-item .fi-txt small { color: #ff8a80; }
html[data-tema] .ok { color: var(--ac); }
#sidebar[data-sec="logs"].open .panel { width: min(560px, 100vw - var(--rail)); }

/* ---------- cartões ---------- */
html[data-tema] .card-p, html[data-tema] .loja-card, html[data-tema] .contato-link, html[data-tema] .modal-box {
  background: var(--s2); border: 1px solid var(--ln); color: var(--tx); border-radius: var(--r); box-shadow: var(--glow);
}
html[data-tema] .loja-card { transition: transform .15s var(--ease), border-color .15s, box-shadow .15s; }
html[data-tema] .loja-card:hover { transform: translateY(-2px); border-color: var(--ringc); box-shadow: 0 10px 30px rgba(0,217,255,.12); }
html[data-tema] .contato-link:hover { background: var(--s3); border-color: var(--ringc); }
html[data-tema] .contato-link svg.ic { color: var(--ac); }
html[data-tema] .lc-foto, html[data-tema] .al-foto { background-color: var(--s3); color: var(--mu); }
html[data-tema] .lc-meta { color: var(--mu) !important; }
html[data-tema] .badge { background: rgba(0,217,255,.12); color: var(--ac); border: 1px solid rgba(0,217,255,.28); }
html[data-tema] .badge.admin { background: var(--ac); color: var(--ink); border-color: var(--ac); font-weight: 700; }
html[data-tema] .escolha-titulo { color: var(--tx); }
html[data-tema] .modal { background: rgba(0,0,0,.7); }
html[data-tema] .modal-box p { color: var(--mu); }

/* ---------- tabela de produtos ---------- */
html[data-tema] table { background: var(--s1); border: 1px solid var(--ln); border-radius: 16px; box-shadow: var(--glow); }
html[data-tema] th { background: var(--s2); color: var(--mu); font-weight: 600; letter-spacing: .06em; border-bottom: 1px solid var(--ln); }
html[data-tema] td { border-bottom: 1px solid var(--ln); }
html[data-tema] tbody tr { transition: background .12s; }
html[data-tema] tbody tr:hover { background: rgba(0,217,255,.04); }
html[data-tema] tbody tr:last-child td { border-bottom: 0; }
html[data-tema] td img { border: 1px solid var(--ln); border-radius: 6px; }
html[data-tema] tr.pend td:first-child { box-shadow: inset 3px 0 0 #ffb648; }
html[data-tema] tr.falhou td:first-child { box-shadow: inset 3px 0 0 #ff5252; }
html[data-tema] .dot { background: #ffb648; box-shadow: 0 0 8px #ffb648; }
html[data-tema] .dot.red { background: #ff5252; box-shadow: 0 0 8px #ff5252; }
html[data-tema] #form { padding: .75rem; background: var(--s1); border: 1px solid var(--ln); border-radius: var(--r); }
html[data-tema] #lightbox { background: rgba(0,0,0,.82); }
html[data-tema] #lb-close { background: var(--s1); color: var(--tx); border: 1px solid var(--ln); }
html[data-tema] #scrim { background: rgba(0,0,0,.55); }

/* ---------- avisos (toasts) ---------- */
html[data-tema] .toast { background: var(--s2); color: var(--tx); border: 1px solid var(--ln); border-left: 3px solid var(--ac); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.45); }
html[data-tema] .toast.ok { background: var(--s2); border-left-color: #2de08a; }
html[data-tema] .toast.err { background: var(--s2); border-left-color: #ff5252; }

/* ---------- logs ---------- */
html[data-tema] #logs-filtro, html[data-tema] #logs-tipo, html[data-tema] #logs-q { width: 100%; }
.logs-filtros { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin-bottom: .45rem; }
.logs-filtros #logs-q { grid-column: 1 / -1; }
.logs-resumo { font-size: .78rem; color: var(--mu); margin: .35rem 0 .2rem; }
html[data-tema] .log-item { border-bottom: 1px solid var(--ln); padding: .65rem 0; align-items: flex-start; animation: li-in .25s var(--ease) both; }
@keyframes li-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
html[data-tema] .li-ic {
  width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: var(--s3); border: 1px solid var(--ln); font-size: .95rem; flex: none;
}
html[data-tema] .log-item.t-ok .li-ic { background: rgba(45,224,138,.12); border-color: rgba(45,224,138,.35); }
html[data-tema] .log-item.t-err .li-ic { background: rgba(255,82,82,.12); border-color: rgba(255,82,82,.4); }
html[data-tema] .log-item.t-sec .li-ic { background: rgba(255,182,72,.12); border-color: rgba(255,182,72,.4); }
html[data-tema] .log-item.t-ac .li-ic { background: rgba(0,217,255,.12); border-color: rgba(0,217,255,.35); }
html[data-tema] .li-txt b { font-size: .88rem; font-weight: 500; color: var(--tx); }
html[data-tema] .li-txt small { color: var(--mu); }
html[data-tema] .li-user { color: var(--ac) !important; font-weight: 600; }
.li-hora { font-variant-numeric: tabular-nums; }

/* ---------- seletor de tema ---------- */
html[data-tema] .tema-opt { border-radius: 12px; border: 2px solid var(--ln); transition: transform .12s var(--ease), border-color .15s; }
html[data-tema] .tema-opt:hover { transform: translateY(-1px); }
html[data-tema] .tema-opt.on { border-color: var(--ac); box-shadow: 0 0 0 3px var(--ringc); }
.tema-opt[data-t="escuro"] { background: #050505; border-color: rgba(255,255,255,.12); }
.tema-opt[data-t="tec"] { background: #030507; color: #00e5ff; box-shadow: inset 0 0 18px rgba(0,229,255,.12); }

/* ---------- login ---------- */
html[data-tema] .login-body, html[data-tema] #login-bg { background-color: #030405; }
html[data-tema] .card-login { background: #050607; border: 1px solid rgba(0,217,255,.3); box-shadow: 0 0 60px rgba(0,217,255,.10), 0 20px 60px rgba(0,0,0,.6); border-radius: 24px; }
html[data-tema] .card-login::before { content: ""; }
html[data-tema] .subtitulo-login { color: #00d9ff; }
html[data-tema] .form-login input { background: #0b0f14; color: #e6f7ff; border: 1px solid rgba(0,217,255,.3); border-radius: 12px; }
html[data-tema] .form-login input:focus { border-color: #00d9ff; box-shadow: 0 0 0 3px rgba(0,217,255,.16); }
html[data-tema] .botao-ios { border-radius: 999px; }
html[data-tema] .login-erro { color: #ff8a80; }

/* ---------- detalhes ---------- */
html[data-tema] *::-webkit-scrollbar { width: 8px; height: 8px; }
html[data-tema] *::-webkit-scrollbar-thumb { background: rgba(0,217,255,.22); border-radius: 8px; }
html[data-tema] *::-webkit-scrollbar-thumb:hover { background: rgba(0,217,255,.4); }
html[data-tema] .cf-bolha.ig { background: linear-gradient(135deg, #00d9ff, #0a6cff); }
html[data-tema] #crop-canvas { border: 1px solid var(--ln); }
@media (prefers-reduced-motion: reduce) { html[data-tema] * { animation: none !important; transition: none !important; } }


/* ---- v3: cada seção abre como PÁGINA CHEIA (some a lista de produtos), sem 2ª barra lateral ---- */
:root { --h: 58px; }
#scrim { display: none !important; }
#sidebar { display: contents; }
#sidebar .rail { position: sticky; top: var(--h); height: calc(100vh - var(--h)); align-self: flex-start; z-index: 14; }
#sidebar.open .panel, #sidebar .panel {
  position: fixed; top: var(--h); right: 0; bottom: 0; left: var(--rail);
  width: auto; height: auto; z-index: 12; padding: 0; border: 0; box-shadow: none;
  overflow-y: auto; transition: none;
}
#sidebar:not(.open) .panel { display: none; }
#sidebar.expanded .panel { left: var(--rail-open); }
html[data-tema] #sidebar.open .panel { background: var(--bg); padding: 1.6rem 2rem 3rem; }
html[data-tema="escuro"] #sidebar.open .panel, html[data-tema="tec"] #sidebar.open .panel {
  background: radial-gradient(900px 420px at 8% -8%, rgba(0,217,255,.07), transparent 60%), var(--bg); }
.panel > section { max-width: 920px; margin: 0 auto; }
.panel-head { position: sticky; top: -1.6rem; z-index: 2; margin: -1.6rem -2rem 1rem; padding: 1.2rem 2rem .8rem;
  background: inherit; border-bottom: 1px solid var(--ln); }
html[data-tema] .panel-head { background: var(--bg); }
.panel-head h2 { font-size: 1.35rem; }
.panel-head .closep { width: auto; padding: .45rem .9rem; font-size: .88rem; }
.panel .card-p, .panel .contato-link { max-width: 720px; }
.loja-cards { max-width: 720px; }
.logs-filtros { grid-template-columns: 1fr 1fr 2fr; }
.logs-filtros #logs-q { grid-column: auto; }
@media (max-width: 760px) {
  #sidebar.open .panel, #sidebar .panel { left: var(--rail); width: auto; }
  html[data-tema] #sidebar.open .panel { padding: 1.2rem 1rem 3rem; }
  .panel-head { margin: -1.2rem -1rem 1rem; padding: 1rem; }
  .logs-filtros { grid-template-columns: 1fr; }
}


#sidebar .panel, #sidebar[data-sec].open .panel { width: auto !important; }

.panel > section { max-width: 760px; }
.panel > section[data-panel="logs"] { max-width: 1000px; }
.panel .card-p, .panel .contato-link, .loja-cards { max-width: none; }

/* =====================================================================
   v4 — páginas separadas (Início, Preços, Importar, Histórico, Acessos…)
   ===================================================================== */
main { display: none; }
.closep { display: none !important; }
.panel > section { max-width: 800px; }
.panel > section[data-panel="importar"],
.panel > section[data-panel="historico"], .panel > section[data-panel="logs"],
.panel > section[data-panel="inicio"], .panel > section[data-panel="acessos"] { max-width: 1180px; }
.panel > section[data-panel="precos"] { max-width: 1560px; }
.panel > section[data-panel="phist"] { max-width: 1280px; }
/* filtros do histórico de preços: tudo na mesma linha, mesma altura, rótulo ao lado da data */
.busca { align-items: center; }
.busca .ph-dt { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: .5rem; margin: 0; white-space: nowrap;
  font-size: .85rem; color: var(--mu, #8fa2ac); }
.busca .ph-dt input[type=date] { width: 160px; }
.busca #ph-origem, .busca .ph-dt input, .busca #ph-limpar { height: 42px; box-sizing: border-box; margin: 0; }
#ph-q { flex: 1 1 100%; }
#ph-conta { margin-left: auto; align-self: center; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.ph-sub { color: var(--mu); font-size: .85rem; }
.ph-acts { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.btn-link { display: inline-block; padding: .5rem .8rem; border-radius: 10px; font-weight: 600; font-size: .9rem; text-decoration: none;
  background: var(--s3); color: var(--tx); border: 1px solid var(--ln); cursor: pointer; }
.btn-link:hover { border-color: var(--ac); }
.btn-link.ghost { background: transparent; }

/* permissões */
.ro .w { display: none !important; }
.nog .g { display: none !important; }
.sem-loja .st-rail { display: none !important; }
.ro .tb-prod input { pointer-events: none; opacity: .85; }
#loja-sel { max-width: 220px; padding: .35rem .6rem; border-radius: 999px; font-size: .85rem; }

/* Início */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .7rem; margin: .4rem 0 1rem; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .9rem 1rem; text-align: left; border-radius: 14px;
  background: var(--s2) !important; border: 1px solid var(--ln) !important; color: var(--tx); }
.stat b { font-size: 1.9rem; line-height: 1.1; letter-spacing: -.02em; }
.stat span { font-size: .8rem; color: var(--mu); font-weight: 500; }
.stat:hover { transform: translateY(-2px); border-color: var(--ringc) !important; }
.stat.hot b { color: #ffb648; } .stat.bad b { color: #ff6b6b; } .stat.warn b { color: #ffd166; }
.ini-acoes { display: flex; gap: .55rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* filtros da página de preços */
.busca { flex-wrap: wrap; }
.busca select { padding: .5rem .6rem; }
table.tb-prod th:nth-child(1) { width: auto; }
table.tb-prod th:nth-child(2) { width: 100px; }
table.tb-prod th:nth-child(3) { width: 150px; }
table.tb-prod th:nth-child(4) { width: 150px; }
table.tb-prod th:nth-child(5) { width: 150px; }
table.tb-prod th:nth-child(6) { width: 130px; }
table.tb-prod th:nth-child(7) { width: 290px; }
table.tb-prod td select { width: 100%; padding: .4rem .3rem; font-size: .8rem; }
#form select { flex: 1 1 200px; width: auto; min-width: 200px; }
#form button { flex: 0 0 auto; }
table.tb-prod th:nth-child(5) { width: 185px; }
.mais { text-align: center; padding: 1rem 0 .4rem; }
td.vazio { text-align: center; color: var(--mu); padding: 1.6rem .6rem; }

/* Importar */
.drop { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: 1.6rem 1rem; text-align: center; cursor: pointer;
  border: 2px dashed var(--ln); border-radius: 16px; background: var(--s1); color: var(--tx); margin: .6rem 0 .8rem;
  transition: border-color .15s, background .15s; }
.drop svg.ic { width: 34px; height: 34px; color: var(--ac); }
.drop small { color: var(--mu); }
.drop:hover, .drop.over { border-color: var(--ac); background: rgba(0,217,255,.06); }
.aviso { margin: .3rem 0; padding: .5rem .7rem; border-radius: 10px; font-size: .86rem; background: rgba(255,182,72,.1); border: 1px solid rgba(255,182,72,.35); color: #ffcf87; }
.aviso.err { background: rgba(255,82,82,.1); border-color: rgba(255,82,82,.4); color: #ff9a90; }
.imp-top { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .6rem 0; }
.imp-tabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.tab { padding: .4rem .8rem !important; font-size: .85rem; border-radius: 999px !important; background: transparent !important; color: var(--mu) !important; }
.tab b { margin-left: .3rem; color: var(--tx); }
.tab.on { background: rgba(0,217,255,.14) !important; color: var(--ac) !important; border-color: rgba(0,217,255,.4) !important; }
.imp-sel { display: flex; gap: .4rem; }
.tb-wrap { overflow-x: auto; }
table.imp-table { table-layout: auto; }
table.imp-table th { width: auto !important; }
table.imp-table td small { display: block; color: var(--mu); font-size: .75rem; margin-top: .1rem; }
table.imp-table td.mono { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
table.imp-table tr.sel td { background: rgba(0,217,255,.05); }
.diff .antes { color: var(--mu); text-decoration: line-through; }
.diff .up, .diff small.up { color: #ffb648; } .diff .down, .diff small.down { color: #2de08a; }
.diff small { display: inline !important; margin-left: .35rem; }
.st { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; border: 1px solid var(--ln); }
.st-alt { background: rgba(255,182,72,.12); color: #ffb648; border-color: rgba(255,182,72,.4); }
.st-igual { background: rgba(255,255,255,.05); color: var(--mu); }
.st-novo { background: rgba(0,217,255,.12); color: var(--ac); border-color: rgba(0,217,255,.4); }
.imp-rodape { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: .9rem;
  position: sticky; bottom: 0; padding: .7rem 0; background: var(--bg); border-top: 1px solid var(--ln); }
.chk { display: flex; align-items: center; gap: .45rem; font-size: .9rem; cursor: pointer; margin: 0 !important; font-weight: 500 !important; }
.chk input { width: auto !important; accent-color: var(--ac); }
small.bl { display: block; color: var(--mu); }
.modal-box.wide { max-width: 640px; max-height: 80vh; overflow-y: auto; }

/* Minha conta / temas */
.tema-acoes { display: flex; gap: .5rem; margin-top: .7rem; }
.tema-acoes button { margin-top: 0 !important; width: auto !important; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* Acessos */
.chk-lista { display: flex; flex-direction: column; gap: .35rem; padding: .6rem .7rem; border: 1px solid var(--ln); border-radius: 10px; background: var(--s2); max-height: 180px; overflow-y: auto; }
.au-id { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.au-id small { display: block; color: var(--mu); }
.au-ini { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none;
  background: rgba(0,217,255,.14); color: var(--ac); font-weight: 700; }
.au-lojas { display: flex; flex-wrap: wrap; gap: .3rem; margin: .5rem 0 .2rem; }
.chip-s { font-size: .74rem; padding: .1rem .5rem; border-radius: 999px; background: var(--s3); border: 1px solid var(--ln); }
.au-acesso { display: block; color: var(--mu); margin-top: .2rem; }
.adm-user.inativo { opacity: .6; }
.badge.off { background: rgba(255,82,82,.14); color: #ff8a80; border-color: rgba(255,82,82,.4); }
.au-editf { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--ln); }
.panel .row { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }


.panel label.drop { display: flex; font-weight: 400; }
html[data-tema] *::-webkit-scrollbar-track { background: transparent; }
html[data-tema] * { scrollbar-color: rgba(0,217,255,.3) transparent; scrollbar-width: thin; }

.panel .busca select { width: auto !important; flex: none; }
.panel .busca #q { flex: 1 1 260px; width: auto; min-width: 200px; }

/* barra lateral: UMA coluna só que rola junto (antes o grupo de baixo ficava fixo), com títulos de grupo */
#sidebar .rail { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; }
#sidebar .rail::-webkit-scrollbar { width: 4px; }
#sidebar .rail::-webkit-scrollbar-thumb { background: #ffffff33; border-radius: 4px; }
#sidebar .rail-scroll { flex: none; min-height: auto; overflow: visible; }
#sidebar .rail-bottom { flex: none; margin-top: .6rem; padding-top: .6rem; }
.rail-tit { display: none; margin: .7rem .7rem .15rem; font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #8fa2ac; }
#sidebar.expanded .rail-tit { display: block; }
.rail-tit.adm { color: #ffb648; }
.rail-tit[hidden] { display: none !important; }
#sidebar .rail-sep { margin: .55rem .3rem; }

/* tabela de preços com a coluna "Preço antigo" e "Modelo e estilo" (vence as regras antigas por vir depois) */
table.tb-prod th:nth-child(1) { width: auto; }
table.tb-prod th:nth-child(2) { width: 96px; }
table.tb-prod th:nth-child(3) { width: 96px; }
table.tb-prod th:nth-child(4) { width: 140px; }
table.tb-prod th:nth-child(5) { width: 130px; }
table.tb-prod th:nth-child(6) { width: 190px; }
table.tb-prod th:nth-child(7) { width: 130px; }
table.tb-prod th:nth-child(8) { width: 290px; }
td.cel-mod { display: table-cell; }
td.cel-mod select + select { margin-top: .3rem; }
/* prévia grande: aumenta a etiqueta (ela é pequena) mantendo os pixels nítidos */
#lightbox img { min-width: min(92vw, 560px); }
