:root {
  --bg: #0f1115;
  --cartao: #171a21;
  --borda: #2a2f3a;
  --txt: #e8eaf0;
  --txt-mute: #8b93a3;
  --acento: #e8b23f;
  --perigo: #e0555f;
  --ok: #4fae6a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, "Segoe UI", Inter, sans-serif;
  min-height: 100vh;
}
.tela-cheia {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cartao {
  background: var(--cartao);
  border: 1px solid var(--borda);
  border-radius: 16px;
  padding: 28px;
  max-width: 380px;
  width: 100%;
}
.marca { font-size: 14px; letter-spacing: .08em; color: var(--acento); text-transform: uppercase; margin-bottom: 8px; }
h1 { font-size: 22px; margin: 0 0 8px; }
.sub { color: var(--txt-mute); font-size: 14px; line-height: 1.5; margin-bottom: 18px; }
input, textarea {
  width: 100%;
  background: #0c0e12;
  border: 1px solid var(--borda);
  border-radius: 10px;
  color: var(--txt);
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 10px;
  font-family: inherit;
}
textarea { resize: vertical; }
.botao {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.botao-primario { background: var(--acento); color: #1a1305; }
.botao-secundario { background: #232833; color: var(--txt); width: auto; }
.botao-perigo { background: var(--perigo); color: #fff; width: auto; }
.botao-sm { padding: 6px 10px; font-size: 12px; }
.erro { color: var(--perigo); font-size: 13px; margin-top: 10px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--borda);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
}
.topbar-dir { display: flex; gap: 8px; }
.conteudo { max-width: 820px; margin: 0 auto; padding: 20px 16px 60px; }
.barra-acoes { display: flex; gap: 10px; margin-bottom: 20px; }
.barra-acoes input { margin: 0; flex: 1; }
.barra-acoes .botao { width: auto; white-space: nowrap; }

.grupo-categoria h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--txt-mute);
  margin: 24px 0 10px;
}
.cartao-segredo {
  background: var(--cartao);
  border: 1px solid var(--borda);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.cs-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cs-linha { font-size: 13px; color: var(--txt-mute); margin: 4px 0; display: flex; align-items: center; gap: 8px; }
.cs-linha a { color: var(--acento); }
.cs-segredo code.cs-valor { background: #0c0e12; padding: 3px 8px; border-radius: 6px; color: var(--ok); }
.cs-notas { font-size: 13px; color: var(--txt-mute); margin-top: 6px; white-space: pre-wrap; }
.vazio { color: var(--txt-mute); text-align: center; padding: 40px 0; }

.modal-fundo {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20;
}
.modal-caixa {
  background: var(--cartao); border: 1px solid var(--borda); border-radius: 16px;
  padding: 22px; max-width: 440px; width: 100%; max-height: 88vh; overflow-y: auto;
}
.modal-caixa h3 { margin-top: 0; }
.campo { margin-bottom: 12px; }
.campo label { display: block; font-size: 12px; color: var(--txt-mute); margin-bottom: 4px; }
.modal-acoes { display: flex; gap: 8px; margin-top: 16px; align-items: center; }
.flex-spacer { flex: 1; }

.lista-dispositivos { margin-bottom: 14px; }
.linha-dispositivo {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--borda); font-size: 14px;
}
.linha-dispositivo small { color: var(--txt-mute); }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--acento); color: #1a1305; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; z-index: 50;
}

@media (min-width: 480px) {
  .botao-secundario, .botao-perigo { width: auto; }
}
