:root {
  --bg: #eef1f8;
  --card: #fff;
  --ink: #1b2240;
  --muted: #6b7394;
  --line: #e4e8f3;
  --navy: #0c1b4d;
  --navy-2: #14296b;
  --roxo: linear-gradient(135deg, #8b3dff, #5b4bff);
  --rosa: linear-gradient(135deg, #ff4d8d, #ff6a5c);
  --verde: linear-gradient(135deg, #12b886, #3ddc97);
  --azul: linear-gradient(135deg, #1e6bff, #19b5ff);
  --ouro: linear-gradient(135deg, #f3d77a, #d4a83a 60%, #b8861f);
  --c-roxo: #6f3bff;
  --c-verde: #12b886;
  --c-rosa: #ff4d8d;
  --c-azul: #1e6bff;
  --pos: #0f9d6b;
  --neg: #e5484d;
  --warn: #c98a00;
  --radius: 14px;
  --sombra: 0 2px 10px rgba(30, 40, 90, .07);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 "Nunito Sans", -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--c-roxo); }
h1, h2, h3 { margin: 0; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }

/* layout */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--navy); padding: 14px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.side .marca { background: #000; border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.side .marca img { width: 100%; display: block; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a { color: #b8c2ee; text-decoration: none; padding: 10px 12px; border-radius: 10px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.side nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.side nav a.on { color: #fff; background: var(--roxo); box-shadow: 0 4px 14px rgba(111,59,255,.4); }
.side .rodape { margin-top: auto; color: #8f9bd0; font-size: 13px; }
.side .rodape button { margin-top: 8px; width: 100%; }
.main { padding: 0 0 60px; min-width: 0; }
.cabeca { background: var(--navy); color: #fff; padding: 14px 26px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cabeca h1 { font-size: 21px; letter-spacing: .01em; }
.cabeca .filtros { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cabeca select { background: #fff; color: var(--ink); border: 0; width: auto; min-width: 150px; }
.cabeca label { color: #b8c2ee; margin: 0; }
.conteudo { padding: 20px 26px; }

/* componentes */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--sombra); }
.card h3 { font-size: 14px; color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.card.navy { background: var(--navy-2); color: #fff; }
.card.navy h3 { color: #b8c2ee; }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 14px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); margin-bottom: 14px; }
.cols-3 { grid-template-columns: 2fr 1.2fr 1.2fr; margin-bottom: 14px; }
.kpi { color: #fff; position: relative; overflow: hidden; }
.kpi h3 { color: rgba(255,255,255,.85); margin-bottom: 6px; }
.kpi .v { font-size: 27px; font-weight: 800; margin: 2px 0; }
.kpi .s { color: rgba(255,255,255,.88); font-size: 13px; }
.kpi.roxo { background: var(--roxo); } .kpi.rosa { background: var(--rosa); }
.kpi.verde { background: var(--verde); } .kpi.azul { background: var(--azul); }
.kpi .ic { position: absolute; right: 14px; top: 12px; font-size: 26px; opacity: .35; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .muted { color: var(--muted); } .warn { color: var(--warn); }

.barra { height: 10px; background: rgba(255,255,255,.28); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.barra > i { display: block; height: 100%; background: #fff; border-radius: 99px; }
.card .barra { background: #e7ebf7; } .card .barra > i { background: var(--roxo); }
.barra.verde > i { background: var(--verde) !important; }

/* gráfico de colunas */
.colunas { display: flex; align-items: flex-end; gap: 22px; height: 180px; padding: 6px 4px 0; border-bottom: 1px solid var(--line); }
.colunas .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.colunas .b { width: min(70px, 100%); border-radius: 8px 8px 0 0; background: var(--roxo); min-height: 3px; }
.colunas .b.verde { background: var(--verde); }
.colunas .meta { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--c-rosa); }
.colunas .val { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.rotulos { display: flex; gap: 22px; padding: 6px 4px 0; }
.rotulos span { flex: 1; text-align: center; font-size: 12px; color: var(--muted); }
.legenda { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; background: var(--c-roxo); }
.legenda i.m { background: none; border-top: 2px dashed var(--c-rosa); height: 0; width: 14px; border-radius: 0; vertical-align: middle; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
thead.cor th { background: var(--roxo); color: #fff; }
thead.cor th:first-child { border-radius: 10px 0 0 10px; } thead.cor th:last-child { border-radius: 0 10px 10px 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tablewrap { overflow-x: auto; }
tbody tr:hover td { background: #f6f8fe; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #eceffa; color: var(--muted); }
.tag.roxo { background: #efe7ff; color: var(--c-roxo); }
.tag.ok { background: #dcf8ec; color: var(--pos); }
.tag.alerta { background: #fff2d1; color: var(--warn); }
.tag.rosa { background: #ffe3ee; color: var(--c-rosa); }
.tag.azul { background: #e0ecff; color: var(--c-azul); }

.rank { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rank:last-child { border-bottom: 0; }
.rank .n { width: 30px; height: 30px; border-radius: 50%; background: var(--roxo); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.rank:first-child .n { background: var(--ouro); color: #3a2a05; }
.rank .barra { margin: 4px 0 0; }

.lista-navy .linha { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.lista-navy .linha:last-child { border-bottom: 0; }
.lista-navy .barra { background: rgba(255,255,255,.18); }
.lista-navy .barra > i { background: var(--azul); }

/* formulários */
.btn { border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 700; cursor: pointer; background: var(--roxo); color: #fff; }
.btn:hover { filter: brightness(1.08); }
.btn.sec { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.mini { padding: 4px 10px; font-size: 13px; }
.btn.perigo { background: #ffe7e8; color: var(--neg); }
.btn.verde { background: var(--verde); }
input, select, textarea { background: #fff; border: 1px solid #d5dbee; border-radius: 10px; padding: 9px 11px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--c-roxo); outline-offset: 0; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .full { grid-column: 1 / -1; }
.form .check { display: flex; gap: 8px; align-items: center; }
.form .check input { width: auto; }
.form .check label { margin: 0; }
.acoes { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.barra-acoes { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.barra-acoes select { width: auto; }

dialog { background: #fff; color: var(--ink); border: 0; border-radius: var(--radius); padding: 22px; width: min(640px, 94vw); max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(10,20,60,.35); }
dialog::backdrop { background: rgba(12,27,77,.6); }
dialog h2 { margin-bottom: 14px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden; background: linear-gradient(160deg, #0a1640, var(--navy-2) 55%, #2b1a73); isolation: isolate; }
.login::before { content: ''; position: absolute; inset: -20px; z-index: -2; background: url(fundo-escritorio.jpg) center / cover no-repeat; filter: grayscale(1) contrast(1.15) brightness(1.05) blur(1px); opacity: .5; }
.login::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(160deg, rgba(10,22,64,.78), rgba(20,41,107,.62) 55%, rgba(43,26,115,.78)), radial-gradient(60% 50% at 50% 100%, rgba(212,168,58,.30), transparent 70%), radial-gradient(50% 45% at 85% 0%, rgba(139,61,255,.38), transparent 70%), radial-gradient(90% 80% at 50% 50%, transparent 45%, rgba(6,12,40,.7) 100%); }
.login .box { width: min(420px, 100%); background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-radius: 18px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login .logo { background: #000; border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.login .logo img { width: 100%; display: block; }
.login form { display: grid; gap: 12px; }
.erro { color: var(--neg); font-size: 14px; min-height: 20px; }
.vazio { color: var(--muted); padding: 18px 0; text-align: center; }

@media (max-width: 900px) {
  .cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .side .marca { max-width: 220px; margin: 0 auto 10px; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side .rodape { display: none; }
  .cabeca, .conteudo { padding-left: 16px; padding-right: 16px; }
  .form { grid-template-columns: 1fr; }
}

/* estoque estilo anúncio */
.lista-anuncios { overflow: hidden; }
.anuncio { border-bottom: 1px solid var(--line); }
.anuncio:last-child { border-bottom: 0; }
.anuncio-linha { display: grid; grid-template-columns: 96px 1fr auto; gap: 16px; padding: 16px 18px; align-items: start; }
.foto { width: 96px; height: 96px; border-radius: 10px; border: 1px solid var(--line); background: #f4f6fd; display: grid; place-items: center; overflow: hidden; cursor: pointer; }
.foto:hover { border-color: var(--c-roxo); }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sem-foto { text-align: center; font-weight: 800; font-size: 24px; color: #b6bdd8; line-height: 1.1; }
.sem-foto small { display: block; font-size: 11px; font-weight: 600; color: var(--c-roxo); }
.info .status { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.status.ok { color: var(--pos); } .status.alerta { color: var(--warn); } .status.zero { color: var(--neg); }
.info .titulo { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip { font-size: 12px; font-weight: 600; padding: 3px 10px; border: 1px solid #d5dbee; border-radius: 99px; background: #fff; }
.chip.off { color: #a6adc9; background: #f4f6fd; text-decoration: line-through; }
.info .sub { color: var(--muted); font-size: 13px; }
.lado { text-align: right; min-width: 170px; }
.lado .preco { font-size: 24px; font-weight: 700; }
.lado .sem-preco { color: var(--muted); font-size: 14px; }
.lado .botoes { margin-top: 10px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.vars { padding: 0 18px 16px 130px; }
.vars thead th { background: #f4f6fd; color: var(--muted); }
@media (max-width: 800px) {
  .anuncio-linha { grid-template-columns: 72px 1fr; }
  .foto { width: 72px; height: 72px; }
  .lado { grid-column: 1 / -1; text-align: left; }
  .lado .botoes { justify-content: flex-start; }
  .vars { padding: 0 12px 14px; }
}

.foto { position: relative; }
.n-fotos { position: absolute; right: 4px; bottom: 4px; background: rgba(12,27,77,.85); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.gfoto { border: 1px solid var(--line); border-radius: 12px; padding: 8px; position: relative; background: #fff; }
.gfoto img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.gfoto .ouro-tag { position: absolute; left: 14px; top: 14px; background: var(--ouro); color: #3a2a05; }
.gacoes { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* painel: topo e gráfico rumo ao milhão */
.hero { display: grid; grid-template-columns: 1.1fr 1.2fr 1fr; gap: 14px; margin-bottom: 14px; }
.hero .card h3 { margin-bottom: 6px; }
.hero-relogio { background: var(--navy); color: #fff; }
.hero-data { color: #b8c2ee; font-weight: 700; }
.hero-data::first-letter { text-transform: uppercase; }
.hero-hora { font-size: 44px; font-weight: 800; letter-spacing: .02em; line-height: 1.1; margin: 4px 0; font-variant-numeric: tabular-nums; }
.hero-atual { color: #b8c2ee; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.pulso { width: 9px; height: 9px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 0 0 rgba(61,220,151,.7); animation: pulso 1.8s infinite; }
@keyframes pulso { 70% { box-shadow: 0 0 0 9px rgba(61,220,151,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,151,0); } }
.hero-valor { background: var(--ouro); color: #2d2004; }
.hero-fat { background: var(--verde); color: #fff; }
.hero-valor h3, .hero-fat h3 { color: inherit; opacity: .85; }
.hero .v { font-size: 34px; font-weight: 800; line-height: 1.15; }
.hero .s { font-size: 13px; opacity: .88; margin-top: 4px; }
.grafico { margin-bottom: 18px; padding: 18px 20px; }
.grafico-topo { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.grafico-topo > div:first-child { flex: 1 1 auto; min-width: 0; }
.grafico-pct { flex: 0 0 auto; }
@media (max-width: 700px) { .grafico-topo { flex-wrap: wrap; } }
.grafico-topo h2 { font-size: 22px; }
.grafico-pct { text-align: right; } .grafico-pct b { display: block; font-size: 30px; color: var(--c-roxo); line-height: 1; } .grafico-pct span { color: var(--muted); font-size: 13px; }
.svg-milhao { width: 100%; height: auto; display: block; margin: 8px 0; }
.grafico-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.grafico-stats span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.grafico-stats b { font-size: 17px; }
h2.secao { font-size: 18px; margin: 6px 0 12px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } .hero-hora { font-size: 36px; } }

.abas-estoque { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.aba { border: 1px solid #d5dbee; background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 99px; font-weight: 700; cursor: pointer; }
.aba span { background: #eceffa; color: var(--muted); border-radius: 99px; padding: 1px 8px; font-size: 12px; margin-left: 4px; }
.aba.on { background: var(--roxo); color: #fff; border-color: transparent; }
.aba.on span { background: rgba(255,255,255,.25); color: #fff; }

.filtro-zerados { display: inline-flex; gap: 8px; align-items: center; margin: 0 0 0 auto; color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.filtro-zerados input { width: auto; }
