/* Mesa · PropsBR — terminal. Feito pro monitor ultrawide de 49" (5120×1440) e que também funciona no celular. */
:root {
  --bg: #050a07; --bg2: #08110b; --bg3: #0c1810; --linha: #163322; --linha2: #1f4a30;
  --tx: #c8f7d6; --dim: #5f8a6d; --dim2: #3b5c46;
  --verde: #39ff88; --ambar: #ffb547; --verm: #ff4d5e; --ciano: #4dd8ff; --roxo: #c792ff; --branco: #eafff1;
  --fonte: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--tx); font-family: var(--fonte); font-size: 13px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 999; background: repeating-linear-gradient(0deg, rgba(0,0,0,.07) 0 1px, transparent 1px 3px); }
a { color: var(--ciano); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: var(--tx); background: var(--bg3); border: 1px solid var(--linha2); border-radius: var(--r); padding: 4px 10px; cursor: pointer; }
button:hover { border-color: var(--verde); color: var(--verde); }
input, textarea, select { font: inherit; color: var(--branco); background: var(--bg); border: 1px solid var(--linha2); border-radius: var(--r); padding: 6px 8px; font-size: 16px; }
input:focus, textarea:focus { outline: none; border-color: var(--verde); box-shadow: 0 0 0 2px rgba(57,255,136,.15); }
.dim { color: var(--dim); } .dim2 { color: var(--dim2); }
.ok { color: var(--verde); } .warn { color: var(--ambar); } .err { color: var(--verm); } .info { color: var(--ciano); } .roxo { color: var(--roxo); }
.mono { font-family: var(--fonte); }
.cursor::after { content: '█'; animation: pisca 1s steps(1) infinite; color: var(--verde); margin-left: 2px; }
@keyframes pisca { 50% { opacity: 0; } }
@keyframes pulsa { 0%,100% { box-shadow: 0 0 0 0 rgba(255,77,94,.0); } 50% { box-shadow: 0 0 18px 2px rgba(255,77,94,.35); } }
@keyframes respira { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

/* ---------- login ---------- */
body.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.lg-box { width: 100%; max-width: 420px; }
.lg-logo { color: var(--verde); font-size: 13px; margin: 0 0 22px; overflow: hidden; }
.lg-logo b { color: var(--branco); }
.lg-box form { display: grid; gap: 12px; }
.lg-box label { display: grid; gap: 8px; color: var(--dim); }
.lg-box button { padding: 10px; border-color: var(--verde); color: var(--verde); }
.lg-msg { min-height: 1.4em; color: var(--dim); }
.lg-msg.err { color: var(--verm); }

/* ---------- topo ---------- */
.topo { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 18px; padding: 8px 16px; background: rgba(5,10,7,.94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--linha); flex-wrap: wrap; }
.marca { color: var(--verde); font-weight: 700; white-space: nowrap; }
.marca b { color: var(--branco); }
.status { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.status .k { color: var(--dim); }
.status .v { color: var(--branco); font-weight: 700; }
.relogio { margin-left: auto; color: var(--dim); white-space: nowrap; }
.topo .acoes { display: flex; gap: 6px; }
.abas { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--linha); background: var(--bg); overflow-x: auto; scrollbar-width: none; position: sticky; top: 41px; z-index: 49; }
.abas::-webkit-scrollbar { display: none; }
.abas button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 12px; color: var(--dim); white-space: nowrap; }
.abas button.on { color: var(--verde); border-bottom-color: var(--verde); }
.abas button .n { color: var(--dim2); margin-left: 4px; }
.abas button.on .n { color: var(--verde); }

/* ---------- caixas de terminal ---------- */
.cx { border: 1px solid var(--linha); border-radius: var(--r); background: var(--bg2); min-width: 0; }
.cx > h2 { margin: 0; padding: 6px 10px; font-size: 12px; font-weight: 500; letter-spacing: .06em; color: var(--dim); border-bottom: 1px solid var(--linha); display: flex; gap: 8px; align-items: center; text-transform: uppercase; }
.cx > h2 b { color: var(--verde); font-weight: 700; }
.cx > h2 .sp { margin-left: auto; text-transform: none; letter-spacing: 0; }
.cx .corpo { padding: 8px 10px; }

/* ---------- MESA (visão principal) ---------- */
.mesa { display: grid; gap: 12px; padding: 12px 16px 24px; grid-template-columns: 1fr; }
.col-telas, .col-centro, .col-sistema { min-width: 0; display: grid; gap: 12px; align-content: start; }

/* telas do app */
.telas { display: flex; gap: 12px; overflow-x: auto; padding: 10px; scroll-snap-type: x mandatory; }
.tel { flex: 0 0 auto; width: 200px; scroll-snap-align: start; }
.tel .moldura { position: relative; border: 2px solid #1d2a22; border-radius: 22px; overflow: hidden; background: #000; aspect-ratio: 390 / 844; box-shadow: 0 0 0 1px #0d1711, 0 8px 24px rgba(0,0,0,.5); }
.tel .moldura img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.tel .moldura .vazio { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); text-align: center; padding: 12px; }
.tel .moldura.tirando::after { content: 'tirando print…'; position: absolute; left: 0; right: 0; bottom: 0; padding: 6px; background: rgba(5,10,7,.85); color: var(--ambar); text-align: center; animation: respira 1.4s infinite; }
.tel .leg { display: flex; justify-content: space-between; gap: 6px; padding: 6px 2px 0; font-size: 12px; }
.tel .leg b { color: var(--branco); font-weight: 500; }

/* palco com o grafo */
.palco { position: relative; padding: 14px; min-height: 420px; }
.palco svg.fios { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; overflow: visible; }
.fios path { fill: none; stroke: var(--linha2); stroke-width: 1.2; stroke-dasharray: 3 4; }
.fios path.quente { stroke: var(--verde); stroke-dasharray: none; opacity: .75; }
.fios path.alerta { stroke: var(--verm); stroke-dasharray: none; }
.fios path.ag { stroke: var(--roxo); opacity: .6; }
.fios path.pj { stroke: var(--ciano); opacity: .35; }
.camada { position: relative; z-index: 1; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.camada + .camada { margin-top: 44px; }
.nucleo { border: 1px solid var(--verde); border-radius: var(--r); background: #071a0e; padding: 10px 16px; text-align: center; box-shadow: 0 0 24px rgba(57,255,136,.15); min-width: 280px; }
.nucleo .t { color: var(--verde); font-weight: 700; font-size: 15px; }
.nucleo .s { color: var(--dim); font-size: 12px; }

.sess { width: 360px; overflow: hidden; min-width: 0; border: 1px solid var(--linha2); border-left: 3px solid var(--dim2); border-radius: var(--r); background: var(--bg3); padding: 8px 10px; display: grid; gap: 4px; }
.sess.trabalhando { border-left-color: var(--verde); }
.sess.deploy { border-left-color: var(--ciano); }
.sess.esperando_voce { border-left-color: var(--ambar); }
.sess.esperando_permissao { border-left-color: var(--verm); border-color: var(--verm); animation: pulsa 2s infinite; }
.sess.ociosa { opacity: .8; }
.sess.encerrada { opacity: .45; }
.sess .l1 { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.sess .l1 .tit { flex: 1 1 auto; min-width: 0; }
.sess .l1 > span { flex-shrink: 0; }
.sess .l1 .tit { flex-shrink: 1; }
.sess .num { color: var(--branco); font-weight: 700; }
.sess .est { font-size: 11px; padding: 0 6px; border-radius: 3px; border: 1px solid currentColor; text-transform: uppercase; letter-spacing: .04em; }
.sess .tit { color: var(--branco); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess .proj { margin-left: auto; color: var(--ciano); font-size: 12px; white-space: nowrap; }
.sess .faz { color: var(--tx); font-size: 12px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sess .faz::before { content: '› '; color: var(--verde); }
.sess .ped { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess .ped::before { content: 'você: '; color: var(--ambar); }
.sess .chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { font-size: 11px; padding: 0 6px; border-radius: 3px; background: #10251a; color: var(--dim); border: 1px solid var(--linha); white-space: nowrap; }
.chip.ag { color: var(--roxo); border-color: #3d2a5c; background: #150f22; }
.chip.sk { color: var(--ciano); border-color: #1c3f4d; background: #0b1a20; }
.chip.ar { color: var(--tx); }
.chip.on { color: var(--verde); border-color: var(--verde); }
.sess .rod { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--dim); flex-wrap: wrap; }
.sess .rod button { margin-left: auto; padding: 1px 8px; font-size: 11px; }
.sess details { font-size: 12px; }
.sess details summary { cursor: pointer; color: var(--dim); list-style: none; }
.sess details summary::-webkit-details-marker { display: none; }
.sess details .resp { white-space: pre-wrap; color: var(--tx); margin: 6px 0 0; max-height: 220px; overflow: auto; border-left: 1px solid var(--linha2); padding-left: 8px; }
.sess details ol { margin: 6px 0 0; padding-left: 18px; color: var(--dim); }
.sess details ol li span { color: var(--tx); }

.no-ag { border: 1px solid #3d2a5c; background: #120d1d; color: var(--roxo); border-radius: var(--r); padding: 4px 10px; font-size: 12px; }
.no-ag { display: inline-flex; gap: 6px; align-items: baseline; }
.no-ag.parado { opacity: .38; border-style: dashed; }
.no-ag.usado { opacity: .85; }
.no-ag.on { box-shadow: 0 0 14px rgba(199,146,255,.45); border-color: var(--roxo); color: #e7d4ff; opacity: 1; animation: respira 2.2s infinite; }
.no-ag .q, .no-pj .q { color: var(--dim); font-size: 11px; }
.rotulo-camada { width: 100%; text-align: center; color: var(--dim2); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: -4px; }
.no-pj { border: 1px solid #1c3f4d; background: #0a161b; color: var(--ciano); border-radius: var(--r); padding: 4px 10px; font-size: 12px; }
.no-pj { display: inline-flex; gap: 6px; align-items: center; }
.no-pj.ativo { border-color: var(--ciano); box-shadow: 0 0 12px rgba(77,216,255,.25); }
.no-pj .pts { display: inline-flex; gap: 2px; }
.no-pj .pts i { width: 6px; height: 6px; border-radius: 50%; background: var(--dim2); display: inline-block; }
.no-pj .pts i.ok { background: var(--verde); } .no-pj .pts i.err { background: var(--verm); }

.no-ar { border: 1px solid var(--linha2); background: var(--bg3); color: var(--tx); border-radius: var(--r); padding: 4px 10px; font-size: 12px; display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; max-width: 520px; }
.no-ar.tem-falha { border-color: #5c3a1a; }
.no-ar .pts { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.no-ar .pts i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim2); display: inline-block; }
.no-ar .pts i.ok { background: var(--verde); } .no-ar .pts i.warn { background: var(--ambar); } .no-ar .pts i.err { background: var(--verm); box-shadow: 0 0 6px var(--verm); }
.no-ar .q { color: var(--dim); font-size: 11px; }
.vazio-palco { color: var(--dim); text-align: center; padding: 30px; }

/* listas e tabelas */
.lin { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--linha); align-items: baseline; }
.lin:last-child { border-bottom: 0; }
.lin .t { overflow: hidden; text-overflow: ellipsis; }
.lin .m { color: var(--dim); font-size: 12px; white-space: nowrap; }
.lin .sub { grid-column: 2 / 4; color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.pont { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dim2); }
.pont.ok { background: var(--verde); } .pont.warn { background: var(--ambar); } .pont.err { background: var(--verm); box-shadow: 0 0 8px var(--verm); } .pont.info { background: var(--ciano); }
.rolar { max-height: 420px; overflow: auto; }
.grade-num { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.num-cx { border: 1px solid var(--linha); border-radius: var(--r); padding: 8px; background: var(--bg3); }
.num-cx .v { font-size: 22px; font-weight: 700; color: var(--branco); }
.num-cx .k { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.spark { width: 100%; height: 46px; display: block; }
.spark path.l { fill: none; stroke: var(--verde); stroke-width: 1.5; }
.spark path.a { fill: rgba(57,255,136,.08); }
.spark path.l2 { fill: none; stroke: var(--ambar); stroke-width: 1.2; }

/* visão em lista (abas) */
.vista { padding: 12px 16px 40px; }
.filtro { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.filtro input { flex: 1 1 260px; max-width: 520px; }
.filtro .chips button { font-size: 12px; padding: 3px 8px; }
.filtro .chips button.on { color: var(--verde); border-color: var(--verde); }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; color: var(--dim); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; border-bottom: 1px solid var(--linha2); position: sticky; top: 82px; background: var(--bg); z-index: 2; cursor: pointer; white-space: nowrap; }
table.t td { padding: 5px 8px; border-bottom: 1px dashed var(--linha); vertical-align: top; }
table.t tr:hover td { background: #0a1a10; }
table.t td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t td .d { color: var(--dim); font-size: 12px; display: block; max-width: 760px; }
.cartoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.cartao { min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--linha); border-radius: var(--r); background: var(--bg2); padding: 10px; display: grid; gap: 4px; align-content: start; }
.cartao .h { display: flex; gap: 8px; align-items: baseline; }
.cartao .h b { color: var(--branco); }
.cartao .h .sp { margin-left: auto; }
.cartao .d { color: var(--dim); font-size: 12px; }
.barra { height: 4px; background: var(--linha); border-radius: 2px; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--verde); }
.vazio { color: var(--dim); padding: 20px; text-align: center; }
.tag { font-size: 11px; color: var(--dim); border: 1px solid var(--linha2); border-radius: 3px; padding: 0 5px; white-space: nowrap; }

.fluxo { margin: 6px 0 0; padding-left: 20px; color: var(--tx); }
.fluxo li { margin-bottom: 4px; }
.fluxo .chip { display: inline-flex; gap: 4px; align-items: center; white-space: normal; }
/* modal de recado */
dialog { background: var(--bg2); color: var(--tx); border: 1px solid var(--verde); border-radius: var(--r); padding: 14px; width: min(560px, 94vw); }
dialog::backdrop { background: rgba(0,0,0,.7); }
dialog textarea { width: 100%; min-height: 120px; margin: 8px 0; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--bg3); border: 1px solid var(--verde); color: var(--verde); padding: 8px 14px; border-radius: var(--r); z-index: 1000; }

/* ---------- larguras ---------- */
@media (min-width: 1200px) {
  .mesa { grid-template-columns: minmax(0, 1fr) 360px; }
  .col-telas { grid-column: 1 / 3; }
}
/* ultrawide (49" 5120×1440 e afins): três colunas lado a lado, tudo numa tela */
@media (min-width: 2200px) {
  html, body { font-size: 14px; }
  .mesa { grid-template-columns: 900px minmax(0, 1fr) 640px; height: calc(100vh - 84px); padding-bottom: 12px; }
  .col-telas { grid-column: auto; overflow: hidden; }
  .col-telas .telas { display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; gap: 14px; }
  .tel { width: auto; }
  .col-centro, .col-sistema { overflow: auto; height: 100%; scrollbar-width: thin; scrollbar-color: var(--linha2) transparent; }
  .palco { min-height: calc(100vh - 130px); }
  .sess { width: 460px; }
  .palco .camada + .camada { margin-top: 56px; }
}
@media (min-width: 3800px) {
  .mesa { grid-template-columns: 1180px minmax(0, 1fr) 820px; }
  .col-sistema .grade-num { grid-template-columns: repeat(4, 1fr); }
}
/* celular */
@media (max-width: 640px) {
  .topo { padding: 8px 12px; gap: 8px; }
  .status { gap: 10px; font-size: 12px; }
  .relogio { display: none; }
  .abas { top: 74px; padding: 0 8px; }
  .mesa, .vista { padding: 10px 12px 30px; }
  .sess { width: 100%; }
  .camada { gap: 10px; }
  .camada + .camada { margin-top: 18px; }
  .palco svg.fios { display: none; }
  .nucleo { min-width: 0; width: 100%; }
  .tel { width: 160px; }
  .cartoes { grid-template-columns: 1fr; }
  table.t th { top: 116px; }
  table.t .so-larga { display: none; }
  .tabw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabw table.t th { position: static; }
  html, body { overflow-x: hidden; }
  table.t td .d { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}
