/* =========================================================================
   Painel administrativo
   ========================================================================= */

/* ---------- Boot ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); }
.boot-erro { max-width: 420px; padding: 24px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100dvh; }

.sidebar {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.brand-logo {
  display: grid; place-items: center; flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 12px; overflow: hidden;
  background: var(--primary); color: #fff; font-weight: 700; font-size: .95rem;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-txt strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-txt span { font-size: .78rem; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  height: 42px; padding: 0 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 550; font-size: .925rem;
  text-decoration: none !important; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item .ic { color: var(--muted); }
.nav-item[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.nav-item[aria-current="page"] .ic { color: var(--primary); }
.nav-item .badge { margin-left: auto; }

.sidebar-foot { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 1px solid var(--border); }
.sidebar-foot .btn { justify-content: flex-start; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: 64px; padding: 0 28px;
  background: rgba(245, 246, 250, .85); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid transparent;
}
.topbar.rolou { border-bottom-color: var(--border); }
.topbar-titulo { font-size: 1rem; font-weight: 600; color: var(--muted); }
.topbar-user { margin-left: auto; font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content { width: 100%; max-width: 1180px; margin: 0 auto; padding: 8px 28px 64px; outline: none; }
.view-loading { display: grid; place-items: center; padding: 96px 0; }

.only-mobile { display: none; }
.scrim { display: none; }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 60; width: 280px;
    transform: translateX(-100%); transition: transform .25s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .app.menu-aberto .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .4); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .app.menu-aberto .scrim { opacity: 1; pointer-events: auto; }
  .only-mobile { display: inline-grid; }
  .topbar { padding: 0 12px; height: 58px; }
  .topbar-user { display: none; }
  .topbar-titulo { color: var(--text); }
  .content { padding: 4px 16px 48px; }
}

/* ---------- Cabeçalho de página ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin: 8px 0 20px;
}
.page-head p { margin-top: 4px; }
@media (max-width: 560px) {
  .page-head h1 { font-size: 1.35rem; }
  .page-head > .btn { width: 100%; }
}

/* ---------- Uso do plano ---------- */
.uso { display: flex; align-items: center; gap: 12px; font-size: .85rem; color: var(--muted); }
.uso .progress { width: 140px; }

.aviso-limite {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius);
  background: var(--warning-soft); color: #78350f; font-size: .9rem;
}
.aviso-limite .btn { margin-left: auto; }

/* ---------- Toolbar ---------- */
.toolbar {
  display: grid; grid-template-columns: minmax(0, 1fr) 220px auto; gap: 12px; align-items: center;
  padding: 12px; margin-bottom: 16px;
}
@media (max-width: 820px) {
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar .input-icon { grid-column: 1 / -1; }
  .toolbar .segmented { justify-self: end; }
}
@media (max-width: 480px) {
  .toolbar { grid-template-columns: 1fr; }
  .toolbar .segmented { justify-self: stretch; display: flex; }
  .toolbar .segmented button { flex: 1; }
}

/* ---------- Lista de produtos ---------- */
.prod-head, .prod-row {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) 180px 80px 124px;
  align-items: center; gap: 16px;
}
.prod-head {
  padding: 0 16px 8px; font-size: .75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
}
.prod-head > :nth-child(4) { text-align: center; }
.prod-head > :last-child { text-align: right; }

.prod-list { display: flex; flex-direction: column; gap: 8px; }
.prod-row {
  padding: 10px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.prod-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.prod-row.inativo .prod-thumb, .prod-row.inativo .prod-info, .prod-row.inativo .prod-preco { opacity: .5; }

.prod-thumb {
  position: relative; width: 60px; height: 60px; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center; background: var(--surface-2); color: #94a3b8;
}
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.prod-thumb .qtd {
  position: absolute; right: 3px; bottom: 3px; padding: 0 5px; border-radius: 6px;
  background: rgba(15, 23, 42, .7); color: #fff; font-size: .65rem; font-weight: 600; line-height: 16px;
}

.prod-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.prod-nome { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-meta { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); min-width: 0; }
.prod-meta .sku { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .76rem; }
.prod-meta .cat { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.prod-preco { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.prod-preco s { font-size: .78rem; color: var(--muted); }
.prod-preco b { font-weight: 650; }
.prod-preco .linha { display: flex; align-items: center; gap: 6px; }

.prod-status { display: flex; justify-content: center; }
.prod-acoes { display: flex; justify-content: flex-end; gap: 2px; }

@media (max-width: 860px) {
  .prod-head { display: none; }
  .prod-row {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb info  status"
      "thumb preco acoes";
    gap: 4px 12px; padding: 12px;
  }
  .prod-thumb { grid-area: thumb; width: 64px; height: 64px; align-self: start; }
  .prod-info { grid-area: info; }
  .prod-preco { grid-area: preco; flex-direction: row; align-items: baseline; gap: 6px; flex-wrap: wrap; align-self: end; }
  .prod-status { grid-area: status; justify-content: flex-end; }
  .prod-acoes { grid-area: acoes; margin-right: -6px; }
}

.prod-skel { height: 82px; border-radius: var(--radius); }

/* ---------- Formulário de produto ---------- */
.pf { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; }
.pf-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pf-col + .pf-col { padding-left: 28px; border-left: 1px solid var(--border); }
.pf-sec { display: flex; flex-direction: column; gap: 4px; }
.pf-desconto { color: var(--success); font-weight: 600; }
@media (max-width: 860px) {
  .pf { grid-template-columns: 1fr; gap: 20px; }
  .pf-col + .pf-col { padding-left: 0; border-left: 0; padding-top: 20px; border-top: 1px solid var(--border); }
}

.img-slots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.img-slot {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface); transition: border-color .15s, background .15s;
}
.img-slot.preenchido { border-style: solid; border-color: var(--border); }
.img-slot.erro { border-color: #fca5a5; background: #fff7f7; }

.img-prev {
  position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center; background: var(--surface-2); color: #94a3b8;
}
.img-prev img { width: 100%; height: 100%; object-fit: cover; }
.img-prev.carregando::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--surface-3); border-top-color: var(--primary); animation: girar .7s linear infinite;
}
.img-prev.carregando img { opacity: 0; }
.img-capa {
  position: absolute; left: 4px; top: 4px; padding: 0 6px; border-radius: 6px;
  background: var(--primary); color: #fff; font-size: .62rem; font-weight: 700; line-height: 17px; letter-spacing: .02em;
}
.img-campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.img-status { font-size: .75rem; color: var(--muted); min-height: 1em; }
.img-slot.erro .img-status { color: var(--danger); }
.img-slot.ok .img-status { color: var(--success); }
.img-acoes { display: flex; flex-direction: column; gap: 0; }
@media (max-width: 480px) {
  .img-slot { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 8px; }
  .img-prev { width: 56px; height: 56px; }
}

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .85rem; font-weight: 550; }
.stat-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.stat-ic.verde { background: var(--success-soft); color: var(--success); }
.stat-ic.vermelho { background: var(--danger-soft); color: var(--danger); }
.stat-ic.azul { background: var(--info-soft); color: var(--info); }
.stat-valor { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.stat-rodape { font-size: .8rem; color: var(--muted); }
@media (max-width: 1024px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .stat { padding: 14px; } .stat-valor { font-size: 1.45rem; } }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 960px) { .dash-grid { grid-template-columns: 1fr; } }

.link-box {
  display: flex; align-items: center; gap: 8px; margin: 14px 0 0;
  padding: 6px 6px 6px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border);
}
.link-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; color: var(--text-2); }

.checklist { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; }
.checklist li a { color: inherit; flex: 1; }
.checklist .marca {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--border-strong); color: transparent; flex-shrink: 0;
}
.checklist li.feito .marca { background: var(--success); border-color: var(--success); color: #fff; }
.checklist li.feito span.txt { color: var(--muted); text-decoration: line-through; }

/* ---------- Planos ---------- */
.planos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1024px) { .planos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .planos { grid-template-columns: 1fr; } }
.plano { padding: 24px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.plano.atual { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.plano-preco { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.plano ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plano li { display: flex; gap: 10px; align-items: center; font-size: .9rem; color: var(--text-2); }
.plano li .ic { color: var(--success); }
.plano .btn { margin-top: auto; }

/* ---------- Assinatura ---------- */
.as-resumo { display: flex; flex-direction: column; gap: 12px; }
.as-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.as-plano-atual { display: flex; align-items: center; gap: 12px; }
.as-plano-atual strong { display: block; font-size: 1.2rem; }
.as-texto { color: var(--text-2); }
.as-alerta, .as-aviso { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); font-size: .875rem; }
.as-alerta { background: var(--danger-soft); color: #991b1b; }
.as-aviso { background: var(--info-soft); color: #075985; }
.as-cancelar { color: var(--muted); padding-left: 0; }
.as-cancelar:hover { color: var(--danger); background: transparent; text-decoration: underline; }
.as-rodape { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.as-checkout { display: flex; flex-direction: column; gap: 16px; }
.as-plano-escolhido { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: var(--radius); background: var(--primary-soft); }
.as-plano-escolhido strong { display: block; font-size: 1.15rem; }
.as-preco { font-weight: 700; color: var(--primary); }
.as-recursos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .875rem; color: var(--text-2); }
.as-recursos li { display: flex; gap: 8px; align-items: center; }
.as-recursos .ic { color: var(--success); }

/* ---------- Aparência ---------- */
.ap-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 24px; align-items: start; padding-bottom: 80px; }
.ap-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ap-sec { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.ap-sec > header { display: flex; flex-direction: column; gap: 2px; }
.ap-so-compacto { display: none; }
@media (max-width: 1180px) {
  .ap-grid { grid-template-columns: 1fr; }
  .ap-previa { display: none; }
  .ap-so-compacto { display: inline-flex; }
}
@media (max-width: 560px) { .ap-sec { padding: 16px; } }

.ap-logo-linha { display: flex; gap: 16px; align-items: flex-start; }
.ap-logo-linha .field { flex: 1; }
.ap-logo-prev {
  flex-shrink: 0; width: 76px; height: 76px; border-radius: 20px; overflow: hidden;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.4rem;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.ap-logo-prev img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

.ap-cores { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ap-cor {
  position: relative; width: 34px; height: 34px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--surface); background: var(--cor);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .14); transition: transform .12s, box-shadow .12s;
}
.ap-cor:hover:not(:disabled) { transform: scale(1.08); }
.ap-cor[aria-pressed="true"], .ap-cor-custom.ativa { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.ap-cor-custom { display: grid; place-items: center; overflow: hidden; color: #fff; background: conic-gradient(#f43f5e, #f59e0b, #84cc16, #06b6d4, #6366f1, #d946ef, #f43f5e); }
.ap-cor-custom.ativa { background: var(--cor); }
.ap-cor-custom .ic { filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.ap-cor-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.ap-hex { width: 96px; font-family: ui-monospace, Consolas, monospace; text-transform: lowercase; }

.ap-bloqueavel { position: relative; display: flex; flex-direction: column; gap: 16px; }
.ap-bloqueavel.bloqueado > .field { opacity: .35; pointer-events: none; filter: grayscale(.4); }
.ap-trava:empty { display: none; }
.ap-trava { position: absolute; inset: 0; display: grid; place-items: center; }
.ap-trava-msg {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; text-align: center;
  max-width: 420px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--border); font-size: .875rem;
}

.ap-templates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .ap-templates { grid-template-columns: 1fr; } }
.ap-tpl {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 10px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.ap-tpl:hover { border-color: var(--border-strong); }
.ap-tpl[aria-checked="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.ap-tpl.bloqueado .tpl-thumb { opacity: .55; filter: grayscale(.5); }
.ap-tpl-info { display: flex; flex-direction: column; gap: 2px; padding: 0 4px 2px; }
.ap-tpl-info strong { display: flex; align-items: center; gap: 6px; font-size: .925rem; }
.ap-tpl-info > span { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.ap-tpl-check {
  position: absolute; top: 16px; right: 16px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--primary); color: #fff; box-shadow: 0 0 0 3px #fff;
}

/* Miniaturas esquemáticas dos templates */
.tpl-thumb { aspect-ratio: 16 / 10; border-radius: 9px; overflow: hidden; background: #f4f5f8; display: flex; flex-direction: column; }
.tpl-thumb .th-h { display: block; height: 18%; background: var(--th-s); }
.tpl-thumb .th-corpo { flex: 1; display: grid; gap: 6px; padding: 8px; }
.tpl-thumb span { display: block; border-radius: 4px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.05); position: relative; }
.t-classico .th-corpo { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }
.t-classico span::after { content: ''; position: absolute; left: 4px; right: 40%; bottom: 4px; height: 3px; border-radius: 2px; background: var(--th-p); }
.t-classico span::before { content: ''; position: absolute; inset: 0 0 32%; background: #dfe3ea; border-radius: 4px 4px 0 0; }
.t-vitrine .th-corpo { grid-template-columns: repeat(4, 1fr); padding: 8px 8px 0; }
.t-vitrine span { background: linear-gradient(#cfd5df, #e3e7ee); border-radius: 6px; box-shadow: none; }
.t-vitrine span:nth-child(odd)::after { content: ''; position: absolute; left: 0; bottom: 18%; width: 45%; height: 6px; border-radius: 0 4px 4px 0; background: var(--th-p); }
.t-lista .th-corpo { grid-template-rows: repeat(4, 1fr); gap: 4px; }
.t-lista span { display: flex; align-items: center; gap: 6px; padding: 3px; }
.t-lista span i { width: 16%; height: 100%; border-radius: 3px; background: #dfe3ea; }
.t-lista span b { flex: 1; height: 4px; border-radius: 2px; background: #cfd5df; position: relative; }
.t-lista span b::after { content: ''; position: absolute; right: 8%; top: 0; width: 18%; height: 4px; border-radius: 2px; background: var(--th-p); }
.t-boutique { background: #fbfaf8; }
.t-boutique .th-corpo { grid-template-columns: repeat(2, 1fr); padding: 10px 22%; gap: 14px; }
.t-boutique span { background: #d8d4cd; border-radius: 0; box-shadow: none; }
.t-boutique span::after { content: ''; position: absolute; left: 25%; right: 25%; bottom: -6px; height: 2px; background: var(--th-p); }

/* Barra fixa "alterações não salvas" */
.ap-barra {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 20px; width: min(640px, calc(100vw - 32px));
  padding: 10px 10px 10px 18px; border-radius: 16px;
  background: #0f172a; color: #e2e8f0; box-shadow: var(--shadow-lg);
  animation: barra-in .25s var(--ease);
}
.ap-barra-txt { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 550; flex: 1; }
.ap-barra-acoes { display: flex; gap: 8px; }
.ap-barra .btn-ghost { --_fg: #cbd5e1; }
.ap-barra .btn-ghost:hover { background: rgba(255,255,255,.08); }
@media (min-width: 961px) { .ap-barra { left: calc(50% + 130px); } }
@media (max-width: 520px) {
  .ap-barra { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .ap-barra-acoes .btn { flex: 1; }
}
@keyframes barra-in { from { opacity: 0; transform: translate(-50%, 16px); } }

/* ---------- Prévia ao vivo ---------- */
.ap-previa { position: sticky; top: 76px; }
.pv { display: flex; flex-direction: column; gap: 10px; }
.pv-barra { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pv-palco { position: relative; width: 100%; overflow: hidden; }
.pv-aparelho {
  position: absolute; top: 0; left: 50%; transform-origin: top center; translate: -50% 0;
  border-radius: 34px; overflow: hidden; background: #fff;
  box-shadow: 0 0 0 10px #111827, 0 0 0 11px #374151, 0 30px 60px -20px rgba(0,0,0,.45);
}
.pv-aparelho[data-disp="computador"] { border-radius: 12px; box-shadow: 0 0 0 1px var(--border), 0 20px 50px -20px rgba(0,0,0,.35); }
.pv-aparelho iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.pv-nota { font-size: .78rem; color: var(--muted); text-align: center; margin-top: 14px; }
.modal-body .pv-palco { min-height: 300px; }

/* ---------- Pedidos ---------- */
.nav-contador { min-width: 22px; justify-content: center; }
.pd-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
.pd-filtros { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.pd-cont { font-size: .72rem; opacity: .65; font-weight: 600; }
@media (max-width: 820px) { .pd-toolbar { grid-template-columns: 1fr; } .pd-filtros { justify-self: stretch; } }

.pd-lista { display: flex; flex-direction: column; gap: 10px; }
.pd-card { overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.pd-card.novo { border-left: 4px solid var(--info); }
.pd-card.aberto { box-shadow: var(--shadow); }
.pd-topo {
  width: 100%; display: grid; align-items: center; gap: 4px 14px; padding: 14px 16px;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto auto;
  grid-template-areas: "codigo status cliente data total seta" "codigo status resumo data total seta";
  border: 0; background: none; text-align: left;
}
.pd-topo:hover { background: var(--surface-2); }
.pd-topo > .ic { grid-area: seta; color: var(--muted); }
.pd-codigo { grid-area: codigo; font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: .95rem; letter-spacing: .04em; }
.pd-topo .badge { grid-area: status; }
.pd-cliente { grid-area: cliente; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-resumo { grid-area: resumo; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-data { grid-area: data; font-size: .8rem; white-space: nowrap; }
.pd-total { grid-area: total; font-size: 1.02rem; white-space: nowrap; }
@media (max-width: 680px) {
  .pd-topo {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "codigo status seta" "cliente cliente total" "resumo resumo data";
  }
  .pd-topo .badge { justify-self: start; }
}

.pd-detalhe { padding: 4px 16px 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.pd-itens { list-style: none; margin: 0; padding: 0; }
.pd-itens li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.pd-item-foto { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.pd-item-foto img { width: 100%; height: 100%; object-fit: cover; }
.pd-item-nome { min-width: 0; }
.pd-obs { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warning-soft); color: #78350f; font-size: .875rem; }
.pd-acoes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pd-status { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--text-2); margin-right: auto; }
.pd-status select { width: 160px; }
.pd-excluir:hover { color: var(--danger); background: var(--danger-soft); }
@media (max-width: 520px) {
  .pd-itens li { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .pd-itens li > .muted { grid-column: 2; grid-row: 2; font-size: .8rem; }
  .pd-itens li > b { grid-row: 1 / 3; grid-column: 3; }
  .pd-status { width: 100%; }
  .pd-status select { flex: 1; width: auto; }
}

/* ---------- Banners ---------- */
.bn-list { display: flex; flex-direction: column; gap: 10px; }
.bn-row {
  display: grid; grid-template-columns: 200px minmax(0, 1fr) auto auto; gap: 16px; align-items: center;
  padding: 10px 14px 10px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.bn-row.inativo .bn-thumb, .bn-row.inativo .bn-info { opacity: .5; }
.bn-thumb { aspect-ratio: 8 / 3; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.bn-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bn-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bn-info > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-info .muted { font-size: .85rem; }
.bn-link { display: flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--primary); }
.bn-acoes { display: flex; gap: 2px; }
@media (max-width: 760px) {
  .bn-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "thumb thumb" "info switch" "acoes acoes"; padding: 10px; gap: 10px; }
  .bn-thumb { grid-area: thumb; }
  .bn-info { grid-area: info; }
  .bn-row .switch { grid-area: switch; }
  .bn-acoes { grid-area: acoes; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 6px; }
}

.bn-form { display: flex; flex-direction: column; gap: 16px; }
.bn-prev { position: relative; aspect-ratio: 8 / 3; border-radius: 14px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.bn-prev img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bn-prev-txt { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 0 6%; color: #fff; background: linear-gradient(90deg, rgba(0,0,0,.55), transparent 70%); }
.bn-prev-txt strong { font-size: clamp(1rem, 3vw, 1.6rem); font-weight: 800; line-height: 1.1; max-width: 70%; }
.bn-prev-txt span { font-size: .85rem; max-width: 70%; opacity: .9; }
.bn-prev-vazio { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; }
.bn-prev-vazio.erro { color: var(--danger); }


/* =========================================================================
   Login / cadastro
   ========================================================================= */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100dvh; }
.auth-arte {
  position: relative; overflow: hidden; padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at 0% 0%, #6366f1 0%, transparent 60%),
              radial-gradient(900px 600px at 100% 100%, #a855f7 0%, transparent 55%),
              #1e1b4b;
  color: #e0e7ff;
}
.auth-arte h1 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.6rem); max-width: 460px; }
.auth-arte p { max-width: 420px; margin-top: 14px; color: #c7d2fe; font-size: 1.05rem; }
.auth-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.1rem; }
.auth-logo .brand-logo { background: rgba(255,255,255,.15); }
.auth-mock { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 420px; }
.auth-mock span { aspect-ratio: 3 / 4; border-radius: 14px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); }
.auth-mock span:nth-child(2) { transform: translateY(18px); }

.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.auth-card h2 { font-size: 1.5rem; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-troca { text-align: center; font-size: .9rem; color: var(--muted); }
.auth-troca button, .link-btn { border: 0; background: none; padding: 0; color: var(--primary); font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.auth-erro { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); color: #991b1b; font-size: .875rem; }
.auth-erro:empty { display: none; }

.slug-campo { display: flex; align-items: stretch; }
.slug-campo > span {
  display: grid; place-items: center; padding: 0 10px; max-width: 48%;
  border: 1px solid var(--border-strong); border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: var(--surface-2); color: var(--muted); font-size: .8rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.slug-campo > .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.slug-status { font-size: .8rem; display: flex; align-items: center; gap: 6px; min-height: 1.2em; }
.slug-status.ok { color: var(--success); }
.slug-status.erro { color: var(--danger); }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-arte { padding: 28px 20px; min-height: auto; }
  .auth-arte p, .auth-mock { display: none; }
  .auth-arte h1 { font-size: 1.4rem; margin-top: 16px; }
}
