/* ==========================================================================
   Vi no Japão · painel administrativo
   ========================================================================== */

body.admin {
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bg: #F5F3EF;
  --surface: #FFFFFF;
  --surface-2: #F8F6F3;
  --surface-3: #EFEBE5;
  --line: #EAE5DE;
  --line-strong: #DAD3C9;
  --text: #1C1917;
  --text-2: #57514A;
  --muted: #8A8279;
  --ink: #1C1917;
  --ink-text: #F7F2EA;
  --chart: #2F5597;
  --chart-on: #1F3F78;
  --grid: #EFEBE5;
  --shadow: 0 1px 2px rgba(28, 25, 23, .04), 0 8px 24px -12px rgba(28, 25, 23, .14);
  font-size: 14px;
  color-scheme: light;
}

[data-theme="dark"] body.admin {
  --bg: #121110;
  --surface: #1B1A18;
  --surface-2: #22201E;
  --surface-3: #2B2926;
  --line: #2F2C29;
  --line-strong: #403B36;
  --text: #F3F0EB;
  --text-2: #C2BAB0;
  --muted: #8F877E;
  --accent: #F0506E;
  --accent-hover: #FF6B86;
  --accent-soft: rgba(240, 80, 110, .14);
  --ink: #F3F0EB;
  --ink-text: #1B1A18;
  --chart: #5B86D6;
  --chart-on: #86A8E8;
  --grid: #2B2926;
  --good: #5CC98C;   --good-soft: rgba(92, 201, 140, .14);
  --warn: #E6A748;   --warn-soft: rgba(230, 167, 72, .14);
  --info: #7DA2E8;   --info-soft: rgba(125, 162, 232, .14);
  --teal: #4FC4BC;   --teal-soft: rgba(79, 196, 188, .14);
  --violet: #A595F0; --violet-soft: rgba(165, 149, 240, .15);
  --danger: #F07167; --danger-soft: rgba(240, 113, 103, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
[data-theme="dark"] body.admin .arte { filter: brightness(.92) saturate(.95); }
[data-theme="dark"] body.admin .btn-dark:hover:not(:disabled) { background: #fff; }

html:has(dialog[open]) { overflow: hidden; }
body.admin { padding-bottom: 0; }
.so-mob { display: none; }

/* ---------- estrutura ---------- */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100dvh; }
.lateral {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.lateral-topo { display: flex; align-items: center; justify-content: space-between; padding: 2px 8px 10px; }
.lateral .marca-nome { font-size: 18px; }
.lateral .marca-selo { width: 34px; height: 34px; font-size: 16px; }
.nav { display: grid; gap: 2px; }
.nav-titulo { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 16px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  height: 38px; padding: 0 12px;
  border-radius: 9px;
  color: var(--text-2); text-decoration: none; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav .contador { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.nav .contador.neutro { background: var(--surface-3); color: var(--text-2); }
.lateral-lote { margin-top: auto; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 8px; text-decoration: none; color: inherit; }
.lateral-lote:hover { border-color: var(--line-strong); }
.ll-topo { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); font-weight: 600; }
.ll-num { font-size: 15px; font-weight: 700; }
.ll-sub { font-size: 12.5px; color: var(--text-2); }
.lateral-loja { display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; margin-top: 8px; border-radius: 10px; border: 1px solid var(--line-strong); text-decoration: none; font-weight: 600; font-size: 13px; color: var(--text); }
.lateral-loja:hover { background: var(--surface-2); }

.conteudo { min-width: 0; display: flex; flex-direction: column; }
.barra {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: 64px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid var(--line);
}
.barra-titulo { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.barra-acoes { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }
.icone-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); position: relative; }
.icone-btn:hover { background: var(--surface-3); color: var(--text); }
.icone-btn.so-mob, .icone-btn.menu-btn { display: none; }
.icone-btn .ponto { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.chip-cotacao { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; text-decoration: none; color: var(--text-2); font-variant-numeric: tabular-nums; }
.chip-cotacao:hover { border-color: var(--line-strong); color: var(--text); }
.chip-cotacao .vivo { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--ink-text); font-weight: 700; font-size: 13px; margin-left: 4px; }
.sino-wrap { position: relative; }
.sino-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-height: 420px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 40; }
.sino-menu h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px; }
.notif { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 10px; border-radius: 10px; text-decoration: none; color: inherit; width: 100%; text-align: left; }
.notif:hover { background: var(--surface-2); }
.notif .n-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.notif b { font-weight: 600; font-size: 13px; display: block; }
.notif small { color: var(--muted); font-size: 12px; }

.vista { width: 100%; max-width: 1440px; margin: 0 auto; padding: 28px 28px 96px; outline: none; }
.veu { position: fixed; inset: 0; background: rgba(20, 16, 12, .45); z-index: 59; }

/* ---------- blocos comuns ---------- */
.cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.cab-data { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.cab-titulo { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.cab-sub { color: var(--text-2); margin-top: 4px; }
.cartao { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; min-width: 0; }
.cartao-topo { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.cartao-topo h3 { font-size: 15px; font-weight: 650; }
.cartao-topo .sub, .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.link-mais { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.link-mais:hover { text-decoration: underline; text-underline-offset: 3px; }
.ferramentas { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.ferramentas .espaco { flex: 1; }
.busca-adm { position: relative; display: flex; align-items: center; }
.busca-adm .ic { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.busca-adm input { height: 40px; width: 260px; padding: 0 12px 0 38px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); }
.busca-adm input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.ferramentas .select { width: auto; min-height: 40px; padding-top: 8px; padding-bottom: 8px; border-radius: 10px; font-size: 13.5px; }
.aviso { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 12px; background: var(--info-soft); color: var(--text); font-size: 13.5px; margin-bottom: 18px; }
.aviso .ic { color: var(--info); }
.aviso a { color: var(--info); font-weight: 600; margin-left: auto; white-space: nowrap; }
.vazio-adm { text-align: center; padding: 48px 16px; color: var(--text-2); }
.vazio-adm b { display: block; font-size: 16px; color: var(--text); margin-bottom: 4px; }

.thumb { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; flex: none; background: var(--surface-2); }
.thumb.p { width: 32px; height: 32px; border-radius: 8px; }
.thumbs { display: flex; }
.thumbs .thumb { border: 2px solid var(--surface); margin-left: -8px; }
.thumbs .thumb:first-child { margin-left: 0; }
.origem { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; white-space: nowrap; }
.iniciais { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-weight: 600; font-size: 12px; flex: none; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { padding: 18px 20px; }
.kpi-rot { font-size: 13px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 7px; }
.kpi-rot .ic { color: var(--muted); }
.kpi-valor { font-size: 28px; font-weight: 650; letter-spacing: -.025em; margin-top: 10px; line-height: 1.1; }
.kpi-delta { margin-top: 8px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi-delta b { font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.sobe { color: var(--good); }
.desce { color: var(--danger); }

/* ---------- grades do painel ---------- */
.grade-painel { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.grade-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.pilha { display: grid; gap: 16px; align-content: start; }

/* ---------- gráfico de colunas ---------- */
.grafico { position: relative; }
.grafico svg { display: block; width: 100%; height: auto; overflow: visible; }
.grafico .grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.grafico .base { stroke: var(--line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.grafico text { fill: var(--muted); font-size: 11.5px; font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.grafico .coluna-g { fill: var(--chart); transition: fill .12s; }
.grafico .coluna-g.on { fill: var(--chart-on); }
.grafico .rotulo-max { fill: var(--text); font-weight: 600; }
.grafico .alvo { fill: transparent; cursor: default; outline: none; }
.grafico .alvo:focus-visible { stroke: var(--chart); stroke-width: 1.5; }
.dica {
  position: absolute; z-index: 5; pointer-events: none;
  padding: 8px 11px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 12.5px; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px));
}
.dica b { display: block; font-size: 14px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.dica span { color: var(--text-2); }
.tabela-dados { margin-top: 10px; font-size: 13px; }
.tabela-dados summary { cursor: pointer; color: var(--text-2); font-weight: 500; font-size: 12.5px; width: max-content; }
.tabela-dados summary:hover { color: var(--text); }
.tabela-dados .rolagem { max-height: 220px; overflow: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; }
.tabela-dados table { width: 100%; border-collapse: collapse; }
.tabela-dados th, .tabela-dados td { padding: 6px 12px; text-align: left; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tabela-dados th { position: sticky; top: 0; background: var(--surface-2); font-weight: 600; color: var(--text-2); font-size: 12px; }

/* ---------- barras horizontais ---------- */
.hbarras { display: grid; gap: 16px; position: relative; }
.hbar { display: grid; gap: 7px; outline: none; border-radius: 8px; }
.hbar:focus-visible { box-shadow: 0 0 0 2px var(--chart); }
.hbar-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; }
.hbar-rot { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.hbar-rot .ic { color: var(--muted); }
.hbar-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar-val small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.hbar-trilho { height: 10px; }
.hbar-barra { height: 100%; min-width: 4px; background: var(--chart); border-radius: 0 4px 4px 0; transition: background .12s; }
.hbar:hover .hbar-barra, .hbar:focus-visible .hbar-barra { background: var(--chart-on); }

/* ---------- tarefas ---------- */
.tarefas { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tarefa { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; text-decoration: none; color: inherit; }
.tarefa:hover { background: var(--surface-2); }
.tarefa .t-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.tarefa b { display: block; font-weight: 600; font-size: 13.5px; }
.tarefa small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.tarefa .seta { color: var(--muted); }
.tarefa .t-n { font-variant-numeric: tabular-nums; }

/* ---------- listas compactas ---------- */
.lista-c { display: grid; }
.lc-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.lc-item:last-child { border-bottom: 0; }
.lc-item b { font-weight: 600; font-size: 13.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-item small { color: var(--muted); font-size: 12.5px; }
.lc-item .direita { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.lc-pos { width: 20px; text-align: center; font-weight: 700; color: var(--muted); font-size: 12px; }

/* ---------- cotação e lote ---------- */
.cot-valor { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cot-ex { margin: 12px 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.cot-ex b { color: var(--text); }
.progresso { height: 8px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.progresso > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.progresso.verde { background: var(--good-soft); }
.progresso.verde > span { background: var(--good); }
.mini-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.mini-nums div { padding: 10px; border-radius: 10px; background: var(--surface-2); }
.mini-nums b { display: block; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mini-nums small { font-size: 11.5px; color: var(--muted); }

/* ---------- tabelas ---------- */
.tabela-wrap { overflow-x: auto; }
.tabela { width: 100%; border-collapse: separate; border-spacing: 0; }
.tabela th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabela td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabela tbody tr:last-child td { border-bottom: 0; }
.tabela tbody tr.clicavel { cursor: pointer; }
.tabela tbody tr.clicavel:hover td { background: var(--surface-2); }
.tabela .dir { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabela .forte { font-weight: 600; }
.tabela .fraco { color: var(--muted); font-size: 12.5px; }
.cel-prod { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.cel-prod b { display: block; font-weight: 600; }
.cel-prod small { color: var(--muted); font-size: 12.5px; }
.acoes-linha { display: flex; gap: 2px; justify-content: flex-end; }
.acoes-linha .icone-btn { width: 34px; height: 34px; }
.tr-oculto td { opacity: .55; }
.tr-oculto td:last-child, .tr-oculto td:nth-last-child(2) { opacity: 1; }

/* ---------- kanban de pedidos ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; scroll-snap-type: x proximity; }
.coluna { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 10px; scroll-snap-align: start; transition: background .15s, box-shadow .15s; }
.coluna.sobre { background: var(--info-soft); box-shadow: inset 0 0 0 2px var(--chart); }
.coluna-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 4px 4px 12px; }
.coluna-cab .col-n { font-weight: 700; font-size: 13px; }
.coluna-cab .col-total { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.coluna-lista { display: grid; gap: 8px; min-height: 80px; align-content: start; }
.coluna-mais { display: block; width: 100%; padding: 10px; border-radius: 10px; font-size: 12.5px; font-weight: 600; color: var(--text-2); text-align: center; }
.coluna-mais:hover { background: var(--surface-3); color: var(--text); }
.pcard { display: grid; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); cursor: grab; text-align: left; width: 100%; transition: border-color .15s, box-shadow .15s, transform .15s; }
.pcard:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.pcard:active { cursor: grabbing; }
.pcard.arrastando { opacity: .4; transform: scale(.98); }
.pcard.novo { animation: brilho 2.4s var(--ease); }
@keyframes brilho { 0%, 40% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: var(--shadow-sm); } }
.pc-topo { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.pc-topo b { color: var(--text); font-size: 13px; font-weight: 650; }
.pc-cliente { font-weight: 600; font-size: 13.5px; }
.pc-itens { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); min-width: 0; }
.pc-itens span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-rodape { display: flex; align-items: center; gap: 8px; }
.pc-rodape b { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.pc-rodape .badge { height: 22px; font-size: 11px; }

/* ---------- gaveta do pedido ---------- */
.gp-cab h3 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.gp-cab .sub { margin: 0 0 2px; }
.etapas { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 22px; }
.etapa { display: grid; gap: 6px; font-size: 11.5px; color: var(--muted); text-align: center; }
.etapa i { height: 6px; border-radius: 999px; background: var(--surface-3); }
.etapa.feita i { background: var(--good); }
.etapa.atual i { background: var(--accent); }
.etapa.atual { color: var(--text); font-weight: 600; }
.bloco { padding: 16px 0; border-top: 1px solid var(--line); }
.bloco:first-of-type { border-top: 0; padding-top: 0; }
.bloco h4 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 10px; }
.par { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 13.5px; }
.par span:first-child { color: var(--text-2); }
.par span:last-child { font-variant-numeric: tabular-nums; text-align: right; }
.par.total { font-weight: 700; font-size: 15px; padding-top: 8px; margin-top: 4px; border-top: 1px dashed var(--line-strong); }
.par.total span:first-child { color: var(--text); }
.par.lucro span:last-child { color: var(--good); font-weight: 600; }
.item-p { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 6px 0; }
.item-p b { font-weight: 600; display: block; }
.item-p small { color: var(--muted); font-size: 12.5px; }
.item-p .dir { text-align: right; font-variant-numeric: tabular-nums; }
.historico { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.historico li { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.historico li i { width: 10px; height: 10px; border-radius: 50%; background: var(--good); }
.historico li small { color: var(--muted); font-variant-numeric: tabular-nums; }
.bolha-whats { position: relative; padding: 12px 14px; border-radius: 4px 14px 14px 14px; background: #DCF8C6; color: #111; font-size: 13.5px; line-height: 1.5; margin-bottom: 10px; }
[data-theme="dark"] .bolha-whats { background: #144D37; color: #E9F5EE; }
.acoes-w { display: flex; gap: 8px; flex-wrap: wrap; }
.gp-rodape { display: flex; gap: 10px; width: 100%; align-items: center; }
.gp-rodape .select { width: auto; flex: 1; min-height: 42px; }

/* ---------- editor de produto ---------- */
.editor-corpo { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.editor-campos { display: grid; gap: 24px; }
.ed-bloco { display: grid; gap: 14px; }
.ed-bloco > h4 { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.ed-bloco > h4 .n { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; font-size: 11.5px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.drop { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; padding: 14px; border: 1.5px dashed var(--line-strong); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover { border-color: var(--text-2); }
.drop.sobre { border-color: var(--accent); background: var(--accent-soft); }
.drop-img { width: 112px; height: 112px; border-radius: 12px; overflow: hidden; }
.drop-txt b { display: block; font-weight: 600; margin-bottom: 4px; }
.drop-txt small { color: var(--muted); font-size: 12.5px; line-height: 1.45; display: block; }
.drop-acoes { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.calc { display: grid; gap: 7px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.calc-linha { display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); }
.calc-linha span:last-child { font-variant-numeric: tabular-nums; color: var(--text); }
.calc-total { font-weight: 700; font-size: 15px; padding-top: 8px; border-top: 1px solid var(--line-strong); }
.calc-total span:first-child { color: var(--text); }
.calc-lucro span:last-child { color: var(--good); font-weight: 600; }
.chips-prev { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-prev span { padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line-strong); font-size: 12.5px; }
.linha-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.linha-switch:first-child { border-top: 0; }
.linha-switch b { display: block; font-weight: 600; font-size: 13.5px; }
.linha-switch small { color: var(--muted); font-size: 12.5px; }
.seg.largo { display: flex; }
.seg.largo label { flex: 1; justify-content: center; }
.editor-previa { position: sticky; top: 0; display: grid; gap: 10px; }
.previa-card { background: #FAF6EF; border-radius: 18px; padding: 14px; border: 1px solid var(--line); color: #1B1714; }
.previa-card .pv-img { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; }
.previa-card .pv-selos { position: absolute; top: 8px; left: 8px; display: flex; gap: 5px; flex-wrap: wrap; }
.previa-card .pv-selo { height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; background: #1B1714; color: #fff; }
.previa-card .pv-selo.claro { background: #FCEFD9; color: #965A00; }
.previa-card .pv-loja { font-size: 11.5px; color: #7E746A; margin-top: 12px; }
.previa-card .pv-nome { font-size: 15px; font-weight: 600; line-height: 1.3; margin: 3px 0 8px; font-family: 'DM Sans', var(--font-sans); }
.previa-card .pv-preco { display: flex; align-items: baseline; gap: 8px; }
.previa-card .pv-preco b { font-size: 19px; font-weight: 700; }
.previa-card .pv-preco span { font-size: 12px; color: #7E746A; }
.previa-card .pv-parc { font-size: 12px; color: #4F4740; margin-top: 2px; }
.previa-card .pv-btn { margin-top: 12px; height: 34px; border-radius: 999px; background: #1B1714; color: #F7F2EA; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; }
.previa-card.oculto { opacity: .55; }

/* ---------- lotes e lista de compras ---------- */
.lote-tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 18px; padding-bottom: 2px; scrollbar-width: none; }
.lote-tab { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: 13px; color: var(--text-2); }
.lote-tab:hover { color: var(--text); border-color: var(--text-2); }
.lote-tab[aria-pressed="true"] { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.lote-tab .pt { width: 8px; height: 8px; border-radius: 50%; }
.lote-cab { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr); gap: 28px; align-items: center; margin-bottom: 16px; }
.lote-cab h2 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 4px; }
.lote-cab p { color: var(--text-2); }
.lote-cab .progresso { margin-top: 14px; }
.lote-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.lote-nums div { padding: 14px; border-radius: 12px; background: var(--surface-2); }
.lote-nums b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.lote-nums small { color: var(--muted); font-size: 12px; }
.lote-acoes { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-top: 16px; border-top: 1px solid var(--line); }
.lote-acoes p { font-size: 13px; color: var(--muted); margin-right: auto; }
.grade-lote { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.loja-grupo + .loja-grupo { margin-top: 6px; }
.loja-grupo h4 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; padding: 12px 4px 6px; }
.loja-grupo h4 .ic { color: var(--accent); }
.loja-grupo h4 small { margin-left: auto; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.compra { position: relative; display: grid; grid-template-columns: 22px 40px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 6px; border-radius: 10px; cursor: pointer; }
.compra:hover { background: var(--surface-2); }
.compra input { position: absolute; opacity: 0; pointer-events: none; }
.caixinha { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent; transition: all .15s; background: var(--surface); }
.compra input:focus-visible + .caixinha { box-shadow: var(--ring); }
.compra.feito .caixinha { background: var(--good); border-color: var(--good); color: #fff; }
.compra.feito .compra-nome b { text-decoration: line-through; color: var(--muted); }
.compra .thumb { width: 40px; height: 40px; }
.compra-nome { min-width: 0; }
.compra-nome b { display: block; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compra-nome small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compra-qtd { font-weight: 700; font-variant-numeric: tabular-nums; }
.compra-iene { color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 76px; text-align: right; font-size: 13px; }
.compras-total { display: flex; justify-content: space-between; gap: 12px; padding: 14px 6px 2px; margin-top: 8px; border-top: 1px solid var(--line); font-weight: 600; }

/* ---------- orçamentos ---------- */
.sols { display: grid; gap: 14px; }
.sol { display: grid; gap: 14px; }
.sol-cab { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sol-cab b { display: block; font-weight: 600; }
.sol-cab small { color: var(--muted); font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }
.sol-cab .rel { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.sol-texto { font-size: 15px; line-height: 1.55; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border-left: 3px solid var(--accent); }
.sol-form { display: grid; grid-template-columns: repeat(2, minmax(0, 160px)) 1fr; gap: 12px; align-items: end; }
.sol-res { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line-strong); font-size: 13.5px; }
.sol-res b { font-variant-numeric: tabular-nums; }
.sol-res .tot { font-size: 16px; font-weight: 700; }
.sol-acoes { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- clientes ---------- */
.cel-cliente { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.cel-cliente b { display: block; font-weight: 600; }
.cel-cliente small { color: var(--muted); font-size: 12.5px; }

/* ---------- ajustes ---------- */
.ajustes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.aj-linha { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 200px); gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.aj-linha:first-of-type { border-top: 0; padding-top: 4px; }
.aj-linha b { display: block; font-weight: 600; font-size: 13.5px; }
.aj-linha small { color: var(--muted); font-size: 12.5px; line-height: 1.45; display: block; margin-top: 2px; }
.aj-linha .input, .aj-linha .select { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
.aj-linha.duplo .duo { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.aj-linha .switch { justify-self: end; }
.salvo { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; transition: color .3s; }
.salvo.agora { color: var(--good); }
.exemplo-preco { margin-top: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.exemplo-preco b { color: var(--text); }

/* ---------- menu flutuante ---------- */
.menu-flut { position: fixed; z-index: 70; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); }
.menu-flut p { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 8px 10px 4px; }
.menu-flut button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 13.5px; text-align: left; }
.menu-flut button:hover { background: var(--surface-2); }

.girando { animation: girar .9s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- toasts no painel ---------- */
body.admin .toast { background: #1C1917; color: #F7F2EA; }
[data-theme="dark"] body.admin .toast { background: #2B2926; border: 1px solid #403B36; }

/* ---------- responsivo ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grade-3 { grid-template-columns: 1fr 1fr; }
  .grade-3 > :last-child { grid-column: 1 / -1; }
  .lote-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .grade-painel, .grade-lote, .ajustes { grid-template-columns: 1fr; }
  .lote-cab { grid-template-columns: 1fr; }
  .editor-corpo { grid-template-columns: 1fr; }
  .editor-previa { position: static; order: -1; grid-template-columns: 220px 1fr; align-items: start; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 60; transform: translateX(-100%); transition: transform .28s var(--ease); box-shadow: var(--shadow-lg); }
  .lateral.aberta { transform: none; }
  .icone-btn.menu-btn, .icone-btn.so-mob { display: grid; }
  .barra { padding: 0 14px; }
  .vista { padding: 20px 16px 96px; }
  .chip-cotacao .rot { display: none; }
}
@media (max-width: 640px) {
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-valor { font-size: 21px; }
  .grade-3 { grid-template-columns: 1fr; }
  .cab-titulo { font-size: 22px; }
  .busca-adm, .busca-adm input { width: 100%; }
  .ferramentas .busca-adm { flex: 1 1 100%; }
  .chip-cotacao { display: none; }
  .sino-menu { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; }
  .g2, .sol-form { grid-template-columns: 1fr; }
  .editor-previa { grid-template-columns: 1fr; }
  .drop { grid-template-columns: 80px 1fr; }
  .drop-img { width: 80px; height: 80px; }
  .lote-nums { grid-template-columns: 1fr 1fr; }
  .aj-linha { grid-template-columns: 1fr; }
  .aj-linha .switch { justify-self: start; }
  .compra { grid-template-columns: 22px 36px minmax(0, 1fr) auto; }
  .compra-iene { display: none; }

  /* tabelas viram cartões */
  .tabela.resp thead { display: none; }
  .tabela.resp, .tabela.resp tbody, .tabela.resp tr, .tabela.resp td { display: block; }
  .tabela.resp tr { position: relative; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .tabela.resp tbody tr:last-child { border-bottom: 0; }
  .tabela.resp td { border: 0; padding: 3px 0; }
  .tabela.resp td.dir { text-align: left; }
  .tabela.resp td[data-rot]::before { content: attr(data-rot) ': '; color: var(--muted); font-size: 12px; }
  .tabela.resp td.ocultar-mob { display: none; }
  .tabela.resp .acoes-linha { justify-content: flex-start; margin-top: 4px; }
}

/* ---------- impressão da lista de compras ---------- */
@media print {
  body.admin { background: #fff; color: #000; }
  .lateral, .barra, .demo-pill, .toasts, .lote-tabs, .lote-acoes, .nao-imprimir, .grade-lote > :last-child { display: none !important; }
  .app { display: block; }
  .vista { padding: 0; }
  .cartao { border: 0; padding: 0; }
  .grade-lote { display: block; }
}
