* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: #eef2f7; color: #1f2937; }
#topbar { min-height: 58px; display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #132238; color: #fff; gap: 12px; }
.topbar-left { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.inline-control { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
button, select, input[type="text"] { height: 34px; border-radius: 8px; border: 1px solid #cfd8e3; padding: 0 10px; font-size: 14px; }
button { background: #fff; cursor: pointer; font-weight: 600; }
button:hover { background: #f5f7fb; }
#container { display: flex; height: calc(100vh - 58px); }
#map { flex: 1; min-width: 0; }
#sidebar { width: 420px; max-width: 420px; min-width: 420px; background: #f7f9fc; border-left: 1px solid #dbe3ec; display: flex; flex-direction: column; }
.sidebar-header { padding: 12px; border-bottom: 1px solid #dbe3ec; background: #fff; }
.sidebar-header h3 { margin: 0 0 4px 0; }
#deviceCount, #statusLine { font-size: 13px; color: #5b6470; margin-top: 4px; }
#deviceList { padding: 10px; overflow-y: auto; flex: 1; }
.device-card { background: #fff; border-radius: 12px; padding: 10px; margin-bottom: 10px; border-left: 6px solid #9ca3af; box-shadow: 0 1px 3px rgba(0,0,0,0.08); cursor: pointer; }
.device-card:hover { background: #fdfefe; }
.device-card.moving { border-left-color: #16a34a; }
.device-card.stationary { border-left-color: #f59e0b; }
.device-card.stale { border-left-color: #dc2626; }
.device-name { font-weight: 700; margin-bottom: 4px; }
.device-sub { font-size: 13px; color: #5b6470; margin-bottom: 6px; }
.device-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 13px; }
.device-actions { margin-top: 8px; display: flex; gap: 8px; }
.small-btn { height: 28px; font-size: 12px; padding: 0 8px; }
.group-badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #e5eef9; color: #24476f; margin-top: 4px; }
.note-line { margin-top: 6px; font-size: 12px; color: #516072; }
.empty-state { padding: 12px; background: #fff; border-radius: 12px; color: #516072; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
@media (max-width: 1200px) {
  #sidebar { width: 350px; min-width: 350px; max-width: 350px; }
}
@media (max-width: 900px) {
  #topbar { flex-direction: column; align-items: stretch; }
  .topbar-left, .topbar-right { white-space: normal; }
  #container { flex-direction: column; height: auto; min-height: calc(100vh - 58px); }
  #map { height: 55vh; }
  #sidebar { width: 100%; min-width: 100%; max-width: 100%; height: 45vh; }
}
