/* ============================================================
   LUMINI · FUNIS · construtor com fluxograma (12/out/2026)
   Sistema oficial: Lumini White de base, Warm Ivory de respiro,
   escuros em texto, Pale Gold só como selo (portas, foco, seleção).
   Zero azul. Sem glow. Sombra neutra e baixa.
   ============================================================ */
:root {
  --fun-ivory: #E8E0CE;
  --fun-white: #F6F2EE;
  --fun-linen: #8D7B6A;
  --fun-gold: #CAA967;
  --fun-ink: #241F1B;
  --fun-line: rgba(46,42,38,.10);
}

/* ── Lista ───────────────────────────────────────────────── */
.fun-topo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.fun-topo-txt { flex: 1; min-width: 220px; }
.fun-h2 { font-family: 'Mirante', 'Helvetica Neue', serif; font-size: 20px; font-weight: 500; color: var(--v2-ink); margin: 0; }
.fun-sub { font-size: 11.5px; color: var(--v2-sub); margin-top: 3px; line-height: 1.5; }
.fun-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 20px; }
.fun-card { background: #FFFFFF; border: 1px solid var(--v2-line); border-radius: var(--v2-r-card-lg); box-shadow: var(--v2-shadow); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; min-width: 0; transition: border-color .15s ease, transform .15s ease; }
.fun-card:hover { border-color: rgba(202,169,103,.6); transform: translateY(-1px); }
.fun-card.is-arq { opacity: .72; }
.fun-mini { height: 150px; background: var(--fun-white); border-bottom: 1px solid var(--v2-line); display: flex; align-items: center; justify-content: center; padding: 10px; }
.fun-mini svg { width: 100%; height: 100%; }
.fun-mini-vazia { font-size: 11px; color: var(--v2-ter); }
.fun-card-body { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 6px; }
.fun-card-head { display: flex; align-items: flex-start; gap: 10px; }
.fun-card-nome { flex: 1; font-family: 'Mirante', 'Helvetica Neue', serif; font-size: 15.5px; font-weight: 500; color: var(--v2-ink); line-height: 1.25; min-width: 0; }
.fun-chip { display: inline-flex; align-items: center; font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: var(--v2-r-chip); background: var(--fun-ivory); color: #6B5A33; white-space: nowrap; }
.fun-chip-ativo { background: rgba(95,107,78,.14); color: #4E5A40; }
.fun-chip-pausado { background: rgba(165,101,78,.14); color: #7A4A33; }
.fun-card-meta { font-size: 11px; color: var(--v2-sub); }
.fun-card-meta strong { color: var(--v2-ink); font-weight: 600; }
.fun-card-obj { font-size: 11.5px; color: #5A5049; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fun-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--v2-ter); margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--v2-line); }
.fun-card-acoes { display: flex; gap: 4px; }
.fun-card-acoes button { background: transparent; border: 1px solid transparent; color: var(--v2-sub); font-size: 10.5px; font-weight: 600; padding: 4px 8px; border-radius: 7px; cursor: pointer; font-family: inherit; }
.fun-card-acoes button:hover { background: var(--fun-white); border-color: var(--v2-line-strong); color: var(--v2-ink); }
.fun-card-acoes button.is-danger:hover { color: #7A4A33; }
.fun-vazio { background: #FFFFFF; border: 1px dashed rgba(141,123,106,.45); border-radius: var(--v2-r-card); padding: 28px 24px; text-align: center; font-size: 12.5px; color: var(--v2-sub); line-height: 1.6; margin-bottom: 20px; }
.fun-vazio strong { display: block; color: var(--v2-ink); font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.fun-vazio code { font-size: 11px; background: var(--fun-white); padding: 2px 6px; border-radius: 5px; }
.fun-vazio-acoes { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.fun-legado { padding: 18px 22px; margin-bottom: 16px; gap: 12px; }
.fun-legado-lista { display: flex; flex-direction: column; gap: 8px; }
.fun-legado-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--fun-white); border-radius: 12px; }
.fun-legado-item > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fun-legado-item strong { font-size: 12.5px; font-weight: 600; color: var(--v2-ink); }
.fun-legado-item span { font-size: 11px; color: var(--v2-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* modal de modelos */
.fun-modelos { display: flex; flex-direction: column; gap: 8px; }
.fun-modelo { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "r n" "r d"; column-gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--v2-line-strong); border-radius: 12px; cursor: pointer; background: #FFFFFF; }
.fun-modelo.on { border-color: var(--fun-gold); background: #FBF8F1; }
.fun-modelo input { grid-area: r; accent-color: var(--fun-gold); }
.fun-modelo-nome { grid-area: n; font-size: 13px; font-weight: 600; color: var(--v2-ink); }
.fun-modelo-desc { grid-area: d; font-size: 11px; color: var(--v2-sub); }

/* ── Editor ──────────────────────────────────────────────── */
.fun-editor { display: flex; flex-direction: column; height: calc(100vh - 148px); min-height: 560px; background: #FFFFFF; border: 1px solid var(--v2-line); border-radius: var(--v2-r-card-lg); box-shadow: var(--v2-shadow); overflow: hidden; }
.fun-editor.tela-cheia { position: fixed; inset: 0; z-index: 9990; height: 100vh; border-radius: 0; border: none; }
.fun-ib.on { background: var(--fun-ivory); color: var(--v2-ink); }
.fun-barra { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--v2-line); background: #FBF9F5; flex-wrap: wrap; }
.fun-voltar { background: transparent; border: none; color: var(--v2-sub); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; padding: 6px 8px; border-radius: 8px; }
.fun-voltar:hover { background: var(--fun-white); color: var(--v2-ink); }
.fun-barra-nome { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.fun-nome-input { font-family: 'Mirante', 'Helvetica Neue', serif; font-size: 17px; font-weight: 500; color: var(--v2-ink); border: 1px solid transparent; background: transparent; padding: 2px 6px; margin-left: -6px; border-radius: 8px; width: 100%; max-width: 520px; }
.fun-nome-input:hover { border-color: var(--v2-line-strong); }
.fun-nome-input:focus { outline: none; border-color: var(--fun-gold); background: #FFFFFF; }
.fun-barra-sub { display: flex; align-items: center; gap: 10px; font-size: 10.5px; color: var(--v2-sub); }
.fun-salvo { color: var(--v2-ter); }
.fun-barra-acoes { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fun-ib { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--v2-line-strong); background: #FFFFFF; color: #5A5049; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.fun-ib svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fun-ib:hover:not(:disabled) { border-color: var(--fun-gold); color: var(--v2-ink); }
.fun-ib:disabled { opacity: .4; cursor: default; }
.fun-zoom { font-size: 11px; color: var(--v2-sub); min-width: 38px; text-align: center; font-variant-numeric: tabular-nums; }
.fun-sep { width: 1px; height: 22px; background: var(--v2-line-strong); margin: 0 4px; }
.fun-mais { position: relative; }
.fun-mais-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: #FFFFFF; border: 1px solid var(--v2-line-strong); border-radius: 12px; box-shadow: 0 14px 40px -18px rgba(46,42,38,.4); padding: 6px; min-width: 190px; z-index: 30; flex-direction: column; }
.fun-mais.open .fun-mais-menu { display: flex; }
.fun-mais-menu button { text-align: left; background: transparent; border: none; font-family: inherit; font-size: 12px; color: var(--v2-ink); padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.fun-mais-menu button:hover { background: var(--fun-white); }

.fun-corpo { flex: 1; display: grid; grid-template-columns: 176px minmax(0, 1fr) 300px; min-height: 0; }
.fun-editor.sem-paleta .fun-corpo { grid-template-columns: minmax(0, 1fr) 300px; }
.fun-editor.sem-paleta .fun-paleta { display: none; }

.fun-paleta { border-right: 1px solid var(--v2-line); background: #FBF9F5; overflow-y: auto; padding: 10px 10px 16px; display: flex; flex-direction: column; gap: 3px; }
.fun-paleta-h { display: flex; align-items: center; justify-content: space-between; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--v2-ter); font-weight: 700; padding: 4px 6px 2px; }
.fun-paleta-x { background: transparent; border: none; color: var(--v2-ter); font-size: 15px; cursor: pointer; line-height: 1; padding: 0 2px; }
.fun-paleta-dica { font-size: 10px; color: var(--v2-ter); line-height: 1.45; padding: 0 6px 8px; }
.fun-paleta-item { display: flex; align-items: center; gap: 9px; background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 7px 8px; cursor: pointer; font-family: inherit; font-size: 12px; color: var(--v2-ink); text-align: left; }
.fun-paleta-item:hover { background: #FFFFFF; border-color: var(--v2-line-strong); }
.fun-paleta-item i { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: rgba(141,123,106,.12); background: color-mix(in srgb, var(--c) 14%, #FFFFFF); flex: none; }
.fun-paleta-item i svg { width: 15px; height: 15px; fill: none; stroke: var(--c); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fun-paleta-abrir { position: absolute; left: 12px; top: 12px; z-index: 5; background: #FFFFFF; border: 1px solid var(--v2-line-strong); border-radius: 9px; padding: 6px 10px; font-size: 11.5px; font-weight: 600; color: var(--v2-ink); cursor: pointer; font-family: inherit; }

.fun-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--fun-white); outline: none; touch-action: none; user-select: none; -webkit-user-select: none; }
.fun-stage:focus-visible { box-shadow: inset 0 0 0 2px var(--fun-gold); }
.fun-stage-svg { position: absolute; inset: 0; }
.fun-stage-svg svg { display: block; width: 100%; height: 100%; }
.fun-svg text { pointer-events: none; }
.fun-bg { cursor: grab; }
.fun-node { cursor: grab; }
.fun-node.alvo rect, .fun-node.alvo path:first-child { stroke: var(--fun-gold); stroke-width: 2.4; }
.fun-port { opacity: 0; cursor: crosshair; transition: opacity .12s ease; }
.fun-node:hover .fun-port, .fun-node.on .fun-port { opacity: 1; }
.fun-port:hover { r: 8; fill: var(--fun-gold); }
.fun-edge { cursor: pointer; }
.fun-edge:hover .fun-edge-line { stroke-width: 2.6; }
.fun-stage-dica { position: absolute; left: 12px; bottom: 10px; font-size: 10px; color: var(--v2-ter); background: rgba(255,255,255,.85); padding: 4px 9px; border-radius: 8px; pointer-events: none; max-width: calc(100% - 24px); }
.fun-avisos { position: absolute; right: 12px; bottom: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 60%; }
.fun-avisos button { background: #FFFFFF; border: 1px solid rgba(176,138,46,.35); color: #6B5A33; font-size: 10.5px; padding: 5px 10px; border-radius: 9px; cursor: pointer; font-family: inherit; text-align: right; }
.fun-avisos button:hover { border-color: var(--fun-gold); }
.fun-avisos span { font-size: 10px; color: var(--v2-ter); }
.fun-menu-tipo { position: absolute; z-index: 20; background: #FFFFFF; border: 1px solid var(--v2-line-strong); border-radius: 12px; box-shadow: 0 14px 40px -18px rgba(46,42,38,.4); padding: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 220px; }
.fun-menu-tipo-h { grid-column: 1 / -1; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--v2-ter); font-weight: 700; padding: 4px 8px 2px; }
.fun-menu-tipo button { display: flex; align-items: center; gap: 7px; background: transparent; border: none; font-family: inherit; font-size: 11.5px; color: var(--v2-ink); padding: 6px 8px; border-radius: 8px; cursor: pointer; text-align: left; }
.fun-menu-tipo button:hover { background: var(--fun-white); }
.fun-menu-tipo button i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); flex: none; }

/* inspector */
.fun-inspector { border-left: 1px solid var(--v2-line); background: #FFFFFF; overflow-y: auto; padding: 14px 16px 24px; }
.fun-inspector .inj-field { margin-top: 12px; }
.fun-insp-h { display: flex; align-items: center; gap: 8px; font-family: 'Mirante', 'Helvetica Neue', serif; font-size: 14.5px; font-weight: 500; color: var(--v2-ink); }
.fun-insp-ico { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: rgba(141,123,106,.12); background: color-mix(in srgb, var(--c) 14%, #FFFFFF); }
.fun-insp-ico svg { width: 15px; height: 15px; fill: none; stroke: var(--c); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fun-insp-dica { font-size: 11px; color: var(--v2-sub); line-height: 1.5; margin-top: 8px; }
.fun-insp-dica strong { color: var(--v2-ink); font-weight: 600; }
.fun-insp-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.fun-insp-nums > div { background: var(--fun-white); border-radius: 10px; padding: 9px 11px; display: flex; flex-direction: column; gap: 2px; }
.fun-insp-nums strong { font-family: 'Mirante', 'Helvetica Neue', serif; font-size: 20px; font-weight: 500; color: var(--v2-ink); line-height: 1; }
.fun-insp-nums span { font-size: 10px; color: var(--v2-sub); }
.fun-insp-acoes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--v2-line); }
.fun-insp-acoes .is-danger { color: #7A4A33; }
.fun-cores { display: flex; flex-wrap: wrap; gap: 6px; }
.fun-cores button { width: 22px; height: 22px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.fun-cores button.on { border-color: var(--v2-ink); }
.fun-legenda { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; font-size: 11px; color: var(--v2-sub); }
.fun-legenda > div { display: flex; align-items: center; gap: 8px; }
.fun-legenda i { display: inline-block; width: 26px; height: 2px; flex: none; }

/* histórico */
.fun-hist { display: flex; flex-direction: column; gap: 8px; }
.fun-hist-item { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 12px; padding: 8px 10px; background: var(--fun-white); border-radius: 12px; }
.fun-hist-mini { height: 54px; background: #FFFFFF; border-radius: 8px; border: 1px solid var(--v2-line); overflow: hidden; }
.fun-hist-mini svg { width: 100%; height: 100%; }
.fun-hist-item > div:nth-child(2) { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fun-hist-item strong { font-size: 12.5px; font-weight: 600; color: var(--v2-ink); }
.fun-hist-item span { font-size: 10.5px; color: var(--v2-sub); }

/* responsivo */
@media (max-width: 1100px) {
  .fun-corpo { grid-template-columns: 150px minmax(0, 1fr) 260px; }
}
@media (max-width: 860px) {
  .fun-editor { height: auto; min-height: 0; }
  .fun-corpo { grid-template-columns: 1fr; grid-template-rows: auto minmax(420px, 60vh) auto; }
  .fun-editor.sem-paleta .fun-corpo { grid-template-columns: 1fr; }
  .fun-paleta { flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--v2-line); }
  .fun-paleta-h, .fun-paleta-dica { width: 100%; }
  .fun-inspector { border-left: none; border-top: 1px solid var(--v2-line); }
  .fun-barra-periodo { order: 5; }
}
@media print {
  .fun-barra, .fun-paleta, .fun-inspector, .fun-stage-dica, .fun-avisos { display: none !important; }
}
