* { box-sizing: border-box; font-family: system-ui, sans-serif; }
body { margin: 0; background: #f5f6f8; color: #1a1a1a; }

#login-view { display: flex; align-items: center; justify-content: center; height: 100vh; }
#login-view[hidden] { display: none; }
#login-form { background: white; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); display: flex; flex-direction: column; gap: 0.75rem; width: 280px; }
#login-form input, #login-form button { padding: 0.6rem; font-size: 1rem; }

header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; background: white; border-bottom: 1px solid #e0e0e0; }

.banner { background: #fdecea; color: #b3261e; padding: 0.5rem 1.5rem; margin: 0; }
.error { color: #b3261e; font-size: 0.9rem; }

#layout { display: flex; gap: 1rem; padding: 1rem 1.5rem; height: calc(100vh - 70px); }
#device-pane { width: 320px; background: white; border-radius: 8px; padding: 1rem; overflow-y: auto; }
#device-search { width: 100%; padding: 0.5rem; margin-bottom: 0.75rem; }
#device-list { list-style: none; margin: 0; padding: 0; }
#device-list li { padding: 0.6rem; border-radius: 6px; cursor: pointer; }
#device-list li:hover { background: #f0f2f5; }
#device-list li.selected { background: #e3edff; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.4rem; }
.dot.online { background: #2e7d32; }
.dot.offline { background: #bdbdbd; }

#detail-pane { flex: 1; background: white; border-radius: 8px; padding: 1.5rem; overflow-y: auto; }
#command-form { display: flex; gap: 0.5rem; margin: 1rem 0; }
#command-input { flex: 1; padding: 0.6rem; font-family: monospace; }
#command-form button { padding: 0.6rem 1rem; }

#command-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
#command-list li { border: 1px solid #e0e0e0; border-radius: 6px; padding: 0.75rem; }
.status { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: bold; margin-right: 0.5rem; }
.status-PENDING { background: #eeeeee; color: #555; }
.status-SENT { background: #e3edff; color: #1a56db; }
.status-ACKED { background: #e6f4ea; color: #2e7d32; }
.status-FAILED, .status-EXPIRED { background: #fdecea; color: #b3261e; }
.status-CANCELLED { background: #f0f0f0; color: #888; }
.frame { font-family: monospace; }
.meta { font-size: 0.8rem; color: #666; margin-top: 0.3rem; }
.cancel-button { margin-top: 0.4rem; }

@media (max-width: 700px) {
  #layout { flex-direction: column; height: auto; }
  #device-pane { width: 100%; }
}
