:root {
  --fog: #e8ecef;
  --paper: #ffffff;
  --ink: #1a242c;
  --muted: #5d6b76;
  --line: #cfd6dc;
  --graphite: #1c2329;
  --graphite-2: #262f37;
  --graphite-line: #36414b;
  --amber: #ffb627;
  --green: #3dbe7a;
  --red: #e5484d;
  --sans: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 15px/1.45 var(--sans); color: var(--ink); background: var(--fog); }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }

button, select, input, textarea { font: inherit; color: inherit; }
button {
  border: 1px solid var(--line); background: var(--paper); border-radius: 8px;
  padding: 7px 12px; cursor: pointer;
}
button:hover { border-color: var(--muted); }
button.primary { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }
button.primary:hover { background: #000; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- entrada ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: 100%; max-width: 420px; background: var(--paper); border-radius: 14px;
  padding: 28px; box-shadow: 0 1px 2px rgb(0 0 0 / .06), 0 12px 32px rgb(20 33 43 / .08);
  display: flex; flex-direction: column;
}
.brand { font-family: var(--mono); font-weight: 700; letter-spacing: .02em; font-size: 14px; }
.brand span { color: var(--muted); font-weight: 500; }
.login h1 { font-size: 22px; font-weight: 600; margin: 18px 0 4px; }
.hint { color: var(--muted); margin: 0 0 20px; }
.login label { font-size: 13px; font-weight: 600; margin: 12px 0 6px; }

/* Assinatura: o ID num mostrador de LED, como o display de uma controladora */
.display {
  background: var(--graphite); border-radius: 10px; padding: 14px 16px;
  box-shadow: inset 0 2px 6px rgb(0 0 0 / .45);
}
.display input {
  width: 100%; min-width: 0; border: 0; background: transparent; outline: none;
  font: 700 34px/1 var(--mono); letter-spacing: .08em; color: var(--amber);
  text-shadow: 0 0 12px rgb(255 182 39 / .45); caret-color: var(--amber);
}
.display input::placeholder { color: #3e4952; text-shadow: none; }
.display:focus-within { outline: 2px solid var(--amber); outline-offset: 2px; }

.field {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--paper);
}
.erro { color: var(--red); min-height: 1.4em; margin: 10px 0 6px; font-size: 14px; }
.login .primary { padding: 11px; font-size: 16px; }
.foot { color: var(--muted); font-size: 13px; margin: 18px 0 0; }
.foot a { color: var(--ink); display: inline-block; margin-top: 2px; }

/* ---------- sessão ---------- */
.sessao { height: 100%; display: flex; flex-direction: column; background: var(--graphite); color: #e6ebef; }
.barra {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px; background: var(--graphite-2); border-bottom: 1px solid var(--graphite-line);
}
.quem { display: flex; align-items: center; gap: 8px; min-width: 0; }
.quem strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quem .mono { color: var(--amber); font-size: 13px; }
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.ferramentas { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sessao button, .sessao select {
  background: transparent; border: 1px solid var(--graphite-line); color: #e6ebef;
  border-radius: 7px; padding: 5px 10px; font-size: 13px;
}
.sessao button:hover, .sessao select:hover { border-color: #6c7a86; }
.sessao button[aria-pressed="true"] { background: #e6ebef; color: var(--graphite); border-color: #e6ebef; }
.sessao button.primary { background: var(--amber); color: var(--graphite); border-color: var(--amber); }
.sessao select option { color: var(--ink); }
.sel { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #9aa7b2; }
.sair { color: #ffb3b5 !important; border-color: #6b3a3d !important; }

.corpo { flex: 1; display: flex; min-height: 0; }
.area { flex: 1; position: relative; overflow: auto; display: grid; place-items: center; outline: none; }
.area.real { place-items: start; }
canvas { display: block; background: #000; cursor: default; outline: none; image-rendering: auto; }
.aguarde { position: absolute; inset: 0; display: grid; place-items: center; color: #9aa7b2; pointer-events: none; }
.soltar {
  position: absolute; inset: 12px; border: 2px dashed var(--amber); border-radius: 12px;
  display: grid; place-items: center; background: rgb(28 35 41 / .8); color: var(--amber);
  font-weight: 600; pointer-events: none; text-align: center; padding: 16px;
}

.painel {
  width: 360px; flex-shrink: 0; background: var(--paper); color: var(--ink);
  display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--graphite-line);
}
.painel button { background: var(--paper); color: var(--ink); border-color: var(--line); }
.painel button.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.painel-topo { display: flex; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); align-items: center; }
.icone { width: 32px; padding: 5px 0 !important; }
.caminho {
  flex: 1; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  direction: rtl; text-align: left; color: var(--muted);
}
.lugares { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.lugares button { font-size: 12px !important; padding: 3px 8px !important; }
.lista { list-style: none; margin: 0; padding: 4px 0; overflow: auto; flex: 1; }
.lista li {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 6px; align-items: center;
  padding: 6px 12px; cursor: pointer; font-size: 14px;
}
.lista li:hover, .lista li:focus-visible { background: var(--fog); }
.lista .nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista .tam { font: 12px var(--mono); color: var(--muted); }
.lista .vazio { display: block; color: var(--muted); cursor: default; }
.painel-acoes { padding: 10px; border-top: 1px solid var(--line); }
.painel-acoes button { width: 100%; }
.dica { font-size: 12px; color: var(--muted); margin: 6px 0 0; text-align: center; }
.transferencias { max-height: 35%; overflow: auto; }
.transf { padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.transf .linha { display: flex; justify-content: space-between; gap: 8px; }
.transf .nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transf .st { font: 12px var(--mono); color: var(--muted); white-space: nowrap; }
.transf progress { width: 100%; height: 4px; margin-top: 5px; accent-color: var(--ink); }
.transf.ok .st { color: #1f8a52; }
.transf.falha .st { color: var(--red); }

dialog { border: 0; border-radius: 12px; padding: 20px; width: min(520px, calc(100% - 32px)); }
dialog h2 { font-size: 17px; margin: 0 0 12px; }
dialog textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; resize: vertical; }
.dlg-acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
dialog::backdrop { background: rgb(20 28 34 / .5); }

@media (max-width: 760px) {
  .painel { position: fixed; inset: auto 0 0 0; width: 100%; height: 70%; z-index: 5; border-left: 0; }
  .sel { font-size: 0; gap: 0; }
  .display input { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
