/* Vendas Produtos — painel */
:root {
  --bg: #0b1020; --bg2: #11182c; --card: #151d33; --card2: #1b2540; --line: #26314f; --line2: #33405f;
  --txt: #e8ecf6; --mut: #8f9bb8; --mut2: #6b7794;
  --azul: #3b82f6; --azul2: #2563eb; --verde: #22c55e; --verm: #ef4444; --amar: #f5c542; --lar: #f59e0b; --roxo: #a78bfa;
  --r: 12px; --sh: 0 6px 24px rgba(0,0,0,.25);
  --ease: cubic-bezier(.23,1,.32,1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--txt);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--mut); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
small, .mut { color: var(--mut); }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* estrutura */
.app { display: flex; min-height: 100vh; }
.side { width: 232px; flex: 0 0 232px; background: var(--bg2); border-right: 1px solid var(--line); padding: 16px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; padding: 4px 8px 16px; color: var(--txt); }
.logo i { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--azul), var(--verde));
  display: grid; place-items: center; font-style: normal; color: #fff; font-size: 15px; }
.dash-sel { width: 100%; margin-bottom: 12px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--mut); font-weight: 500; }
.nav a:hover { background: var(--card); color: var(--txt); text-decoration: none; }
.nav a.on { background: rgba(59,130,246,.15); color: #fff; }
.nav .sec { font-size: 11px; color: var(--mut2); text-transform: uppercase; letter-spacing: .06em; padding: 14px 10px 6px; }
.main { flex: 1; min-width: 0; padding: 20px 24px 60px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.top .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.burger { display: none; background: none; border: 1px solid var(--line); color: var(--txt); border-radius: 8px; padding: 6px 10px; font-size: 18px; }

/* cartões */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.grid { display: grid; gap: 12px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kpi .l { color: var(--mut); font-size: 12.5px; display: flex; justify-content: space-between; }
.kpi .v { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--mut2); margin-top: 2px; }
.pos { color: var(--verde) !important; } .neg { color: var(--verm) !important; } .warn { color: var(--lar) !important; }
.mb { margin-bottom: 16px; } .mt { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.sp { flex: 1; }

/* filtros e formulários */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters label, .field label { display: block; font-size: 12px; color: var(--mut); margin-bottom: 4px; }
input, select, textarea { background: var(--bg2); color: var(--txt); border: 1px solid var(--line2); border-radius: 8px;
  padding: 8px 10px; font: inherit; min-height: 38px; max-width: 100%; }
textarea { width: 100%; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(59,130,246,.45); border-color: var(--azul); }
.field { margin-bottom: 12px; }
.field input:not([type=checkbox]):not([type=radio]), .field select { width: 100%; }
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--azul2); color: #fff; border: 0; border-radius: 8px;
  padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer; min-height: 38px; white-space: nowrap;
  transition: transform 120ms var(--ease), background-color 150ms ease; }
.btn:hover { background: var(--azul); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn.sec { background: var(--card2); border: 1px solid var(--line2); color: var(--txt); }
.btn.sec:hover { background: var(--line); }
.btn.red { background: #b91c1c; } .btn.red:hover { background: var(--verm); }
.btn.green { background: #15803d; } .btn.green:hover { background: var(--verde); }
.btn.sm { padding: 5px 10px; min-height: 30px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: wait; }

/* tabelas */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { position: sticky; top: 0; background: var(--card2); color: var(--mut); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .04em; font-weight: 600; z-index: 1; }
th:first-child, td:first-child, th.l, td.l { text-align: left; }
td.name { max-width: 320px; overflow: hidden; text-overflow: ellipsis; text-align: left; }
tr:hover td { background: rgba(255,255,255,.02); }
tfoot td { font-weight: 700; background: var(--card2); }
.sticky1 th:first-child, .sticky1 td:first-child { position: sticky; left: 0; background: var(--card); z-index: 2; }
.sticky1 th:first-child { background: var(--card2); z-index: 3; }
.cname { min-width: 240px; max-width: 340px; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--card2); color: var(--mut); }
.pill.ok { background: rgba(34,197,94,.15); color: var(--verde); }
.pill.pend { background: rgba(245,158,11,.15); color: var(--lar); }
.pill.bad { background: rgba(239,68,68,.15); color: var(--verm); }
.pill.info { background: rgba(59,130,246,.15); color: var(--azul); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--mut); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; }
.tabs a.on { color: #fff; border-color: var(--azul); }
.tabs a:hover { text-decoration: none; color: var(--txt); }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.flash.ok { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.4); }
.flash.erro { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.4); }
.note { background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.3); border-radius: 10px; padding: 10px 14px; color: #c9d6f2; }
.warnbox { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.35); border-radius: 10px; padding: 10px 14px; }

.copy { display: flex; gap: 6px; align-items: stretch; }
.copy input, .copy textarea { flex: 1; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

/* barras simples */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 6px; }
.bars div { flex: 1; background: var(--azul); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; opacity: .85; }
.bars div.neg { background: var(--verm); }
.bars-l { display: flex; gap: 3px; font-size: 10px; color: var(--mut2); }
.bars-l span { flex: 1; text-align: center; }
.funnel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.funnel div { background: var(--card2); border-radius: 10px; padding: 10px; text-align: center; }
.funnel b { display: block; font-size: 18px; }
.list-kv div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.list-kv div:last-child { border: 0; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(5,8,16,.6); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal.open { display: flex; }
.modal .box { background: var(--card); border: 1px solid var(--line2); border-radius: 14px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow: auto; padding: 18px; box-shadow: var(--sh); transform-origin: center;
  animation: pop 180ms var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .modal .box { animation: none; } .btn { transition: none; } }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--card2); border: 1px solid var(--line2);
  padding: 10px 16px; border-radius: 10px; box-shadow: var(--sh); z-index: 60; max-width: 90vw; }

.switch { position: relative; width: 38px; height: 22px; display: inline-block; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line2); border-radius: 99px; cursor: pointer; transition: background-color 150ms ease; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%;
  transition: transform 180ms var(--ease); }
.switch input:checked + span { background: var(--verde); }
.switch input:checked + span::after { transform: translateX(16px); }

.login { max-width: 400px; margin: 8vh auto; padding: 0 16px; }
.empty { text-align: center; padding: 40px 16px; color: var(--mut); }

/* celular */
@media (max-width: 900px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3, .g2 { grid-template-columns: 1fr; }
  .funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform 220ms var(--ease); box-shadow: var(--sh); }
  .side.open { transform: none; }
  .burger { display: inline-block; }
  .main { padding: 14px 16px 60px; }
  .kpi .v { font-size: 19px; }
  .cname { min-width: 150px; max-width: 170px; }
  th, td { padding: 8px 10px; }
}
@media (max-width: 420px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px; }
  .filters > * { flex: 1 1 140px; }
  .filters > div > input, .filters > div > select, .filters .sp input { width: 100% !important; }
  .filters > .btn { flex: 1 1 100%; justify-content: center; }
}
