:root {
  --acento: #5b3df5;
  --acento-escuro: #4229d6;
  --acento-claro: #eeebff;
  --fundo: #f5f5f8;
  --card: #ffffff;
  --texto: #17151d;
  --suave: #6a6677;
  --borda: #e4e2ea;
  --erro: #c62828;
  --aviso-fundo: #fff6dc;
  --aviso-texto: #6e5200;
  --ok: #1b7a45;
  --lateral: 268px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Outfit", system-ui, sans-serif; background: var(--fundo); color: var(--texto); font-size: 15px; }
.hidden { display: none !important; }
a { color: var(--acento); }
h1 { margin: 0; font-size: 24px; font-weight: 600; }
h2 { margin: 0 0 6px; font-weight: 600; font-size: 19px; }
.sub { color: var(--suave); margin: 0 0 12px; font-size: 14px; }
label { display: block; font-weight: 500; font-size: 13px; color: var(--suave); margin: 10px 0; }
input, textarea, select {
  display: block; width: 100%; margin-top: 4px; padding: 9px 11px; font: inherit; color: var(--texto);
  border: 1px solid var(--borda); border-radius: 8px; background: #fff;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--acento-claro); border-color: var(--acento); }
input[type=range] { padding: 0; }

.btn {
  font: inherit; font-weight: 500; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--borda);
  background: #fff; color: var(--texto); cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block;
}
.btn:hover { border-color: var(--acento); }
.btn.primario { background: var(--acento); border-color: var(--acento); color: #fff; }
.btn.primario:hover { background: var(--acento-escuro); }
.btn.perigo { color: var(--erro); }
.btn.link { border-color: transparent; background: none; color: var(--suave); }
.btn.link:hover { color: var(--texto); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.peq { padding: 5px 10px; font-size: 13px; }
.erro { color: var(--erro); min-height: 1em; margin: 6px 0; font-size: 14px; }

.marca { font-weight: 700; display: flex; align-items: center; gap: 9px; font-size: 17px; }
.logo { background: var(--acento); color: #fff; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; font-size: 15px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-box { background: var(--card); padding: 28px; border-radius: 14px; width: 100%; max-width: 360px; border: 1px solid var(--borda); }
.login-box .marca { margin-bottom: 18px; }
.login-box .btn { width: 100%; margin-top: 6px; }

.layout { display: grid; grid-template-columns: var(--lateral) 1fr; min-height: 100vh; }
.lateral { background: var(--card); border-right: 1px solid var(--borda); padding: 18px 14px; display: flex; flex-direction: column;
  gap: 12px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.lateral-titulo { display: flex; justify-content: space-between; align-items: center; font-size: 12px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--suave); margin-top: 10px; }
.arvore { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.arvore a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 8px; text-decoration: none;
  color: var(--texto); font-weight: 500; }
.arvore a:hover { background: var(--fundo); }
.arvore a.ativo { background: var(--acento-claro); color: var(--acento-escuro); }
.arvore a small { color: var(--suave); font-weight: 400; }
.arvore .pastas { margin: 2px 0 6px 12px; padding-left: 8px; border-left: 2px solid var(--borda); display: flex; flex-direction: column; gap: 1px; }
.arvore .pastas a { font-weight: 400; font-size: 14px; padding: 5px 10px; }
.arvore .vazio-lateral { color: var(--suave); font-size: 13px; padding: 6px 10px; }
.lateral-rodape { display: flex; justify-content: space-between; border-top: 1px solid var(--borda); padding-top: 10px; }
.principal { min-width: 0; }
main { padding: 26px 32px 48px; max-width: 1400px; }
.menu-mobile { display: none; margin: 12px 16px 0; }

.cabecalho { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.migalha { font-size: 13px; color: var(--suave); margin-bottom: 4px; }
.migalha a { color: var(--suave); text-decoration: none; }
.migalha a:hover { color: var(--acento); }
.acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--borda); margin-bottom: 18px; }
.abas button { font: inherit; background: none; border: none; padding: 10px 14px; cursor: pointer; color: var(--suave);
  font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.abas button.ativa { color: var(--acento-escuro); border-bottom-color: var(--acento); }
.abas .cont { background: var(--fundo); border-radius: 99px; padding: 1px 8px; font-size: 12px; margin-left: 4px; }

.vazio { text-align: center; color: var(--suave); padding: 56px 16px; background: var(--card); border: 1px dashed var(--borda); border-radius: 12px; }
.vazio .btn { margin-top: 12px; }
.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--borda); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.card .capa { aspect-ratio: 4 / 5; background: #ecebf1 center / contain no-repeat; cursor: pointer; display: block; width: 100%; border: none; }
.card .corpo { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .nome { font-weight: 600; overflow-wrap: anywhere; }
.card .meta { font-size: 13px; color: var(--suave); }
.card .botoes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.card-pasta { padding: 18px; cursor: pointer; gap: 8px; }
.card-pasta:hover { border-color: var(--acento); }
.card-pasta .icone { font-size: 26px; }
.selo { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 99px; background: var(--fundo); color: var(--suave); }
.selo.ok { background: #e3f4ea; color: var(--ok); }
.aviso { background: var(--aviso-fundo); color: var(--aviso-texto); font-size: 13px; padding: 8px 10px; border-radius: 8px; }
.aviso ul { margin: 4px 0 0; padding-left: 18px; }
.campos-lista { display: flex; flex-wrap: wrap; gap: 4px; }
.campos-lista span { font-size: 12px; background: var(--acento-claro); color: var(--acento-escuro); border-radius: 4px; padding: 2px 7px; }
.campos-lista span.img { background: #e6f3ff; color: #0b5cad; }

.upload-zona { border: 2px dashed var(--borda); border-radius: 12px; padding: 22px; text-align: center; color: var(--suave);
  background: var(--card); margin-bottom: 18px; transition: border-color .15s, background .15s; }
.upload-zona.arrastando { border-color: var(--acento); background: var(--acento-claro); }
.upload-zona input { display: none; }
label.upload { display: inline-block; }
label.upload input { display: none; }
label.upload { border: 1px solid var(--borda); border-radius: 8px; padding: 8px 14px; cursor: pointer; color: var(--texto); background: #fff; font-size: 14px; }
label.upload:hover { border-color: var(--acento); }

.dlg { border: none; border-radius: 14px; padding: 24px; width: min(520px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(18, 12, 40, .45); }
.dlg.tela-cheia { width: min(1320px, calc(100vw - 24px)); height: calc(100vh - 24px); max-height: none; padding: 0; }
.linha-botoes { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.lista-fontes { font-size: 13px; color: var(--suave); columns: 2; margin-top: 8px; }

.editor { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(360px, 520px); height: 100%; }
.editor .form { padding: 20px 24px 28px; overflow: auto; }
.editor .lado { background: #15121f; padding: 20px; display: flex; flex-direction: column; gap: 12px; align-items: center; overflow: auto; }
.editor .lado img { width: 100%; border-radius: 6px; background: #000; }
.editor .lado img:not([src]) { display: none; }
.editor .lado .info { color: #b8b2c8; font-size: 13px; text-align: center; }
.editor .lado .aviso { width: 100%; }
.topo-editor { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.modo { display: inline-flex; background: var(--fundo); border-radius: 10px; padding: 3px; margin: 8px 0 4px; }
.modo button { font: inherit; border: none; background: none; padding: 7px 16px; border-radius: 8px; cursor: pointer; color: var(--suave); font-weight: 500; }
.modo button.ativo { background: #fff; color: var(--texto); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.painel-ia { background: var(--acento-claro); border-radius: 12px; padding: 4px 14px 14px; margin: 8px 0; }
.campo { border: 1px solid var(--borda); border-radius: 12px; padding: 4px 14px 12px; margin: 12px 0; background: #fff; }
.campo > label:first-child { color: var(--texto); font-size: 14px; }
.campo .dica { font-size: 12px; color: var(--suave); margin-top: -4px; }
.campo-img { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: start; margin-top: 6px; }
.campo-img .atual { width: 120px; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--fundo); }
.busca-foto { display: flex; gap: 8px; margin-top: 8px; }
.busca-foto input { margin: 0; }
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 8px; }
.fotos button { padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; cursor: pointer; background: none; }
.fotos button:hover { border-color: var(--acento); }
.fotos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.sliders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.downloads { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.selo.carrossel { background: var(--acento-claro); color: var(--acento-escuro); }
.slide-grupo { border-left: 3px solid var(--acento); padding-left: 12px; margin: 18px 0 8px; }
.slide-titulo { font-weight: 600; display: flex; align-items: baseline; gap: 8px; }
.slide-titulo small { color: var(--suave); font-weight: 400; font-size: 13px; }
.slide-grupo .dica { font-size: 13px; color: var(--suave); margin: 6px 0; }
.linha-titulo { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.secao-titulo { font-weight: 600; margin: 20px 0 4px; }

.camadas { display: grid; grid-template-rows: auto 1fr; height: 100%; background: #1e1e1e; color: #e6e6e6; }
.cam-carregando { padding: 40px; text-align: center; color: #bbb; }
.cam-topo { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; background: #2b2b2b; border-bottom: 1px solid #111; flex-wrap: wrap; }
.cam-topo .sub { color: #aaa; margin: 4px 0 0; font-size: 13px; max-width: 720px; }
.cam-cont { color: #c9bfff; font-size: 13px; align-self: center; }
.cam-corpo { display: grid; grid-template-columns: 1fr 380px; min-height: 0; }
.cam-area { overflow: auto; padding: 24px; background: #1e1e1e; min-height: 0; }
.cam-palco { position: relative; margin: 0 auto; cursor: crosshair; user-select: none; background: #fff; box-shadow: 0 2px 18px rgba(0,0,0,.5); }
.cam-palco img { width: 100%; height: 100%; display: block; }
.cam-caixa { position: absolute; pointer-events: none; border: 2px solid var(--acento); background: rgba(91, 61, 245, .12); }
.cam-caixa span { position: absolute; left: -2px; top: -20px; background: var(--acento); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 3px 3px 0 0; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.cam-caixa.ativa { border: 2px dashed #ffcc00; background: rgba(255, 204, 0, .14); }
.cam-caixa.ativa span { background: #ffcc00; color: #222; }
.cam-painel { background: #323232; border-left: 1px solid #111; display: flex; flex-direction: column; min-height: 0; }
.cam-ferramentas { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #1a1a1a; font-size: 13px; }
.cam-ferramentas label { color: #ccc; margin: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.cam-ferramentas input[type=checkbox] { width: auto; margin: 0; }
.cam-ferramentas input[type=range] { width: 100px; margin: 0; }
.cam-lista { overflow: auto; flex: 1; font-size: 13px; }
.cam-linha { display: flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border-bottom: 1px solid #2a2a2a; cursor: pointer; min-height: 34px; }
.cam-linha:hover { background: #3c3c3c; }
.cam-linha.ativa { background: #4a4a4a; }
.cam-linha.marcada .cam-nome { color: #fff; font-weight: 600; }
.cam-linha.oculta { opacity: .5; }
.cam-seta { width: 16px; flex: none; background: none; border: none; color: #bbb; cursor: pointer; padding: 0; font-size: 12px; }
.cam-icone { width: 26px; height: 22px; flex: none; display: grid; place-items: center; background: #252525; border: 1px solid #1a1a1a; border-radius: 3px; font-size: 11px; color: #aaa; }
.cam-icone.t-type { color: #fff; font-weight: 700; font-family: Georgia, serif; }
.cam-icone.t-smartobject, .cam-icone.t-pixel { color: #8fc8ff; }
.cam-icone.t-artboard { color: #c9bfff; }
.cam-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ddd; }
.cam-nome small { display: block; color: #999; font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.cam-chk { margin: 0; display: flex; align-items: center; gap: 5px; color: #ccc; font-size: 12px; background: #262626; padding: 3px 8px; border-radius: 4px; cursor: pointer; flex: none; }
.cam-chk input { width: auto; margin: 0; accent-color: var(--acento); }
.cam-linha.marcada .cam-chk { background: var(--acento); color: #fff; }
.cam-rotulo { padding: 4px 10px 8px; background: #2c2c2c; border-bottom: 1px solid #2a2a2a; }
.cam-rotulo input { margin: 0; background: #1f1f1f; color: #fff; border-color: #444; padding: 6px 9px; font-size: 13px; }
.cam-slide { color: #c9bfff; margin-right: 4px; }
.cam-vazio { padding: 20px; color: #aaa; }

.hud { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column;
  gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.hud-job { background: #14111f; color: #fff; border: 3px solid #fff; border-radius: 6px; padding: 10px 12px 9px;
  box-shadow: 0 0 0 3px #14111f, 0 10px 30px rgba(0,0,0,.45); animation: hud-entra .18s ease-out; transition: opacity .3s, transform .3s; }
.hud-job.saindo { opacity: 0; transform: translateY(10px); }
.hud-topo { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.hud-titulo, .hud-pct { font-family: "Press Start 2P", monospace; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.hud-pct { color: #ffd84a; }
.hud-trilho { height: 20px; border: 2px solid #fff; padding: 2px; background: #000; image-rendering: pixelated; }
.hud-barra { height: 100%; width: 0; transition: width .2s linear;
  background: repeating-linear-gradient(90deg, #7c5cff 0 12px, #5b3df5 12px 14px, transparent 14px 16px);
  box-shadow: 0 0 10px rgba(124, 92, 255, .7); }
.hud-msg { font-size: 13px; color: #d9d4ee; margin-top: 7px; min-height: 1.2em; }
.hud-msg::before { content: "▶ "; color: #ffd84a; animation: hud-pisca 1s steps(2) infinite; }
.hud-job.ok .hud-barra { background: repeating-linear-gradient(90deg, #3ddc84 0 12px, #20a85e 12px 14px, transparent 14px 16px); box-shadow: 0 0 12px rgba(61,220,132,.8); }
.hud-job.ok .hud-pct { color: #3ddc84; }
.hud-job.falhou { border-color: #ff5c5c; }
.hud-job.falhou .hud-barra { background: repeating-linear-gradient(90deg, #ff5c5c 0 12px, #c62828 12px 14px, transparent 14px 16px); box-shadow: none; }
.hud-job.falhou .hud-msg { color: #ffb3b3; }
@keyframes hud-entra { from { opacity: 0; transform: translateY(10px); } }
@keyframes hud-pisca { 50% { opacity: 0; } }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--texto); color: #fff;
  padding: 10px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .lateral { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .lateral.aberta { transform: none; }
  .menu-mobile { display: inline-block; }
  main { padding: 16px 16px 40px; }
  .editor { grid-template-columns: 1fr; height: auto; }
  .dlg.tela-cheia { height: auto; }
  .sliders { grid-template-columns: 1fr; }
  .campo-img { grid-template-columns: 1fr; }
  .cam-corpo { grid-template-columns: 1fr; grid-template-rows: 45vh 1fr; }
  .cam-painel { border-left: none; border-top: 1px solid #111; }
}
